Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit 234437b

Browse files
committed
only try to update current project if there is one
1 parent e299eb0 commit 234437b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pugdebug/pugdebug.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
from pugdebug.models.documents import PugdebugDocuments
2222
from pugdebug.models.file_browser import PugdebugFileBrowser
2323
from pugdebug.models.projects import PugdebugProjects
24-
from pugdebug.models.settings import get_setting, set_setting, save_settings
24+
from pugdebug.models.settings import (get_setting, set_setting,
25+
save_settings, has_setting)
2526

2627

2728
class Pugdebug(QObject):
@@ -418,10 +419,12 @@ def handle_settings_changed(self, changed_settings):
418419
Given argument is a set of settings's names which have been changed.
419420
"""
420421

421-
project_name = get_setting('current_project')
422-
project = self.projects_browser.load_project_by_name(project_name)
422+
if has_setting('current_project'):
423+
project_name = get_setting('current_project')
424+
425+
project = self.projects_browser.load_project_by_name(project_name)
423426

424-
project.set_settings(changed_settings)
427+
project.set_settings(changed_settings)
425428

426429
changed_setting_keys = changed_settings.keys()
427430

0 commit comments

Comments
 (0)