Skip to content

Commit 82f80e2

Browse files
committed
Handle profile selection with no shutdown
Before we threw an error, now we keep the process running
1 parent 833e987 commit 82f80e2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/loader/profile_loader.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ def _watch_profile(self):
6868
# If last line is not a valid profile file, no profile can be loaded so its an error
6969
if potential_profile is None or not os.path.isfile(potential_selected_file):
7070
message = 'The following profile is selected, but could not be found: ' + potential_selected_file
71-
raise Exception(message)
71+
FreePieVars.diagnostics.debug(message)
72+
FreePieVars.diagnostics.notify(message)
73+
return
7274

7375
# If the selected profile file is the same as the current active profile, then nothing to do
7476
elif potential_selected_file == self._active_profile_path:
@@ -106,6 +108,10 @@ def _watch_profile(self):
106108

107109
# If profile selection has not changed, then check whether the active selected profile has changed
108110
else:
111+
# Occurs at first run with invalid profile selection: no profile path exists yet
112+
if self._active_profile_path is None:
113+
return
114+
109115
stamp = os.stat(self._active_profile_path).st_mtime
110116
if stamp != self._cached_selected_profile_stamp:
111117
self._generate_pretty_profile_print()

0 commit comments

Comments
 (0)