1
0
Fork 0
mirror of synced 2024-06-03 11:14:42 +12:00

Fix indexerror when trying to delete a env var that hasnt been saved to the config yet

This commit is contained in:
aznd 2022-03-20 21:42:51 +01:00
parent 12f0f0c806
commit db3b409b18

View file

@ -103,8 +103,12 @@ class EnvVars(QGroupBox, Ui_EnvVars):
if key_item is not None and not key_item.text():
list_of_config_keys = list(self.core.lgd.config[f"{self.app_name}.env"].keys())
try:
config_helper.remove_option(f"{self.app_name}.env", list_of_config_keys[row])
except IndexError:
# Item hasnt been saved to the config yet.
pass
self.env_vars_table.removeRow(key_item.row())
config_helper.remove_option(f"{self.app_name}.env", list_of_config_keys[row])
return
# get all config keys