Skip to content

Commit

Permalink
Resolve error from UI not existing yet
Browse files Browse the repository at this point in the history
  • Loading branch information
mporcheron committed Jun 18, 2020
1 parent d129a2f commit dd007c0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/nottreal/controllers/c_appstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, nottreal, args):
self._dir = self.DEFAULT_DIRECTORY

self._force_off = args.nostate

self._opt_enabled = None
self._enablable = False
self._state_data = {}

Expand Down Expand Up @@ -109,11 +109,14 @@ def enable_app_state_output(self, state):
if self._enablable and not self._force_off:
if state:
Logger.info(__name__, 'Enabled app state saving')
self._opt_enabled.change(True)
else:
Logger.info(__name__, 'Disabled app state saving')
self._opt_enabled.change(False)

try:
self._opt_enabled.change(state)
except AttributeError:
pass

return True
else:
Logger.error(
Expand Down

0 comments on commit dd007c0

Please sign in to comment.