[scripts] fix a bug in run_chooser when no search results are found

This commit is contained in:
Dmytro Meleshko 2021-04-12 00:53:51 +03:00
parent 661aa1785c
commit 855538c921
2 changed files with 25 additions and 23 deletions

View file

@ -61,6 +61,7 @@ def emote_downloader_and_iterator():
chosen_index = common_script_utils.run_chooser(
emote_downloader_and_iterator(), prompt="emote", async_read=True
)
if chosen_index >= 0:
chosen_emote = emotes[chosen_index]
emote_url = urllib.parse.urlparse(chosen_emote["url"])

View file

@ -110,6 +110,7 @@ chosen_index = common_script_utils.run_chooser(
chooser_entries_iter(), prompt="bookmark"
)
if chosen_index >= 0:
_title, url, _folder_path_str = chooser_entries[chosen_index]
print(url)