diff --git a/src/nottreal/controllers/c_appstate.py b/src/nottreal/controllers/c_appstate.py index 3426600..6859184 100644 --- a/src/nottreal/controllers/c_appstate.py +++ b/src/nottreal/controllers/c_appstate.py @@ -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 = {} @@ -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(