Skip to content

Commit 6c15e95

Browse files
committed
Fix #195: null values causing crashes
1 parent ffdcd8a commit 6c15e95

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ def load_package_json(self, json_path=None):
17281728
setting_list = super(MainWindow, self).load_package_json(json_path)
17291729
for setting in setting_list:
17301730
setting_field = self.find_child_by_name(setting.name)
1731-
if setting_field:
1731+
if setting_field and setting.value is not None:
17321732
if (setting.type == 'file' or
17331733
setting.type == 'string' or
17341734
setting.type == 'folder' or

util_classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,10 @@ def __init__(self, name='', display_name=None, value=None,
453453

454454
def filter_name(self, text):
455455
"""Use the filter action to filter out invalid text"""
456-
if hasattr(self.filter_action, text):
456+
if text and hasattr(self.filter_action, text):
457457
action = getattr(self.filter_action, text)
458458
return action(text)
459-
return text
459+
return text or ''
460460

461461
def get_file_information_from_url(self):
462462
"""Extract the file information from the setting url"""

0 commit comments

Comments
 (0)