Fix indexerror when trying to delete a env var that hasnt been saved to the config yet
This commit is contained in:
parent
12f0f0c806
commit
db3b409b18
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue