Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction.py
diff options
context:
space:
mode:
authorkpcyrd <git@rxv.cc>2021-03-30 16:24:48 +0200
committerkpcyrd <git@rxv.cc>2021-03-30 16:24:48 +0200
commit40dbb5791c4be60d671d0a4abd2e9ba70e11b896 (patch)
tree8f8162649bd4a6efd120cde2705f0cc2e5a71008 /archinstall/lib/user_interaction.py
parent82342a0e94ed6d591b9855db590719764e9cb460 (diff)
Add range check to disk selection
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index b3e0b665..80db7be1 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -198,7 +198,10 @@ def select_disk(dict_o_disks):
print(f"{index}: {drive} ({dict_o_disks[drive]['size'], dict_o_disks[drive].device, dict_o_disks[drive]['label']})")
drive = input('Select one of the above disks (by number or full path): ')
if drive.isdigit():
- drive = dict_o_disks[drives[int(drive)]]
+ drive = int(drive)
+ if drive >= len(drives):
+ raise DiskError(f'Selected option "{drive}" is out of range')
+ drive = dict_o_disks[drives[drive]]
elif drive in dict_o_disks:
drive = dict_o_disks[drive]
else: