Don't update OATH credentials list when null

This commit is contained in:
Dain Nilsson 2024-03-18 09:30:59 +01:00
parent a4d4fa538d
commit d6d01ba227
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8

View File

@ -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);