From 915ae88947a008a21006d2572e498ed0c134350c Mon Sep 17 00:00:00 2001 From: Hugo Ankarloo Date: Mon, 20 Sep 2021 20:17:39 +0200 Subject: Fix Bug: Set filesystem crashes if no partitions File: lib/user_interaction.py When function manage_new_and_existing_partitions() is used, and no partitions are configured, and 'Set desired filesystem for a partition' is selected, the installer crashes. --- archinstall/lib/user_interaction.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py index 66dd3350..ca8fb6f6 100644 --- a/archinstall/lib/user_interaction.py +++ b/archinstall/lib/user_interaction.py @@ -730,7 +730,10 @@ def manage_new_and_existing_partitions(block_device :BlockDevice) -> dict: block_device_struct["partitions"][block_device_struct["partitions"].index(partition)]['boot'] = not block_device_struct["partitions"][block_device_struct["partitions"].index(partition)].get('boot', False) elif task == "Set desired filesystem for a partition": - if (partition := generic_select(block_device_struct["partitions"], 'Select which partition to set a filesystem on: ', options_output=False)): + if not block_device_struct["partitions"]: + log("No partitions found. Create some partitions first", level=logging.WARNING, fg='yellow') + continue + elif (partition := generic_select(block_device_struct["partitions"], 'Select which partition to set a filesystem on: ', options_output=False)): if not block_device_struct["partitions"][block_device_struct["partitions"].index(partition)].get('filesystem', None): block_device_struct["partitions"][block_device_struct["partitions"].index(partition)]['filesystem'] = {} -- cgit v1.2.3-70-g09d2