Skip to content

Commit

Permalink
Fix panic on empty options prompt ⚓ (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabyx authored Nov 12, 2021
1 parent b77eb3d commit 3b676de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion githooks/prompt/show-gui-impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ func showOptionsDialog(
case err != nil || res.IsCanceled():
return defaultAnswer, err
case res.IsOk():
return options[res.Options[0]], err
if res.Options == nil {
// nothing chosen
return defaultAnswer, err
} else {
return options[res.Options[0]], err
}
}

cm.Panic("Wrong dialog result state")
Expand Down

0 comments on commit 3b676de

Please sign in to comment.