diff --git a/lib/desktop/oath/state.dart b/lib/desktop/oath/state.dart index 5bd070f6..cdd133f7 100755 --- a/lib/desktop/oath/state.dart +++ b/lib/desktop/oath/state.dart @@ -295,7 +295,7 @@ class DesktopCredentialListNotifier extends OathCredentialListNotifier { code = OathCode.fromJson(result); } _log.debug('Calculate', jsonEncode(code)); - if (update && mounted) { + if (update && mounted && state != null) { final creds = state!.toList(); final i = creds.indexWhere((e) => e.credential.id == credential.id); state = creds..[i] = creds[i].copyWith(code: code);