Merge pull request #250 from insanemal/insanemal-patch-2

OOB in generic_selection
This commit is contained in:
Anton Hvornum 2021-04-09 08:05:42 +00:00 committed by GitHub
commit e5c118239b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -220,7 +220,7 @@ def generic_select(options, input_text="Select one of the above by index or abso
return None
elif selected_option.isdigit():
selected_option = int(selected_option)
if selected_option >= len(options):
if selected_option > len(options):
raise RequirementError(f'Selected option "{selected_option}" is out of range')
selected_option = options[selected_option]
elif selected_option in options: