Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
Fix selecting last opt by number in ask_selection()
Browse files Browse the repository at this point in the history
Fix off by one issue preventing the last option to be selected by
number.
  • Loading branch information
forslund committed Feb 14, 2021
1 parent d724720 commit 3a6ca30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mycroft/skills/mycroft_skill/mycroft_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def ask_selection(self, options, dialog='',
else:
num = extract_number(resp, self.lang, ordinals=True)
resp = None
if num and num < len(options):
if num and num <= len(options):
resp = options[num - 1]
else:
resp = match
Expand Down

0 comments on commit 3a6ca30

Please sign in to comment.