Fixes the crash on empty profile choice. Since generic_select() returns None, we can't pipe that into Profile() (at least not yet)

This commit is contained in:
Anton Hvornum 2021-04-22 10:31:32 +02:00
parent 46b872aa61
commit 4d65639724
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 4 additions and 3 deletions

View File

@ -351,9 +351,10 @@ def select_profile(options):
selected_profile = generic_select(profiles, 'Enter a pre-programmed profile name if you want to install one: ',
options_output=False)
return Profile(None, selected_profile)
raise RequirementError("Selecting profiles require a least one profile to be given as an option.")
if selected_profile:
return Profile(None, selected_profile)
else:
raise RequirementError("Selecting profiles require a least one profile to be given as an option.")
def select_language(options, show_only_country_codes=True):
"""