diff --git a/lib/oath/models.dart b/lib/oath/models.dart index 3dd88bbf..d21dc85f 100755 --- a/lib/oath/models.dart +++ b/lib/oath/models.dart @@ -71,8 +71,14 @@ class OathCredential with _$OathCredential { int period, bool touchRequired) = _OathCredential; - factory OathCredential.fromJson(Map json) => - _$OathCredentialFromJson(json); + factory OathCredential.fromJson(Map json) { + final value = _$OathCredentialFromJson(json); + // Replace empty issuer string with null + return switch (value.issuer) { + (String issuer) when issuer.isEmpty => value.copyWith(issuer: null), + _ => value, + }; + } } @freezed