Skip to content

Commit

Permalink
enum: fix checking if user cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
seanbreckenridge committed Mar 3, 2024
1 parent 13d2fea commit 33d55c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autotui/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,9 @@ def prompt_enum(

fzf = pyfzf.FzfPrompt(default_options="--no-multi -i --height=85%")
resp = fzf.prompt(enum_desc_map.keys())
if not isinstance(resp, str):
if not isinstance(resp, list) or len(resp) == 0:
raise AutoTUIException("No option selected")
resp = resp[0]
assert resp in enum_desc_map, f"Selected option {resp} not in enum"
return enum_desc_map[resp]
else:
Expand Down

0 comments on commit 33d55c8

Please sign in to comment.