fixed db error

This commit is contained in:
Kima 2023-12-28 23:50:20 +01:00
parent f8e2da3345
commit 1ded31491a

View File

@ -129,8 +129,17 @@ class UserDatabaseQuery {
String? recipientsJson = userData.elementAt(0)["recipients"] as String?;
if (recipientsJson == null) return [];
List<SendRecipient> recipients = (jsonDecode(recipientsJson) as List)
.map((e) =>
SendRecipient.fromJson(e, SendRecipientType.fromJson(e['tipus'])))
.map((e) => SendRecipient.fromJson(
e,
SendRecipientType.fromJson(e != null
? e['tipus']
: {
'azonosito': '',
'kod': '',
'leiras': '',
'nev': '',
'rovidNev': ''
})))
.toList();
return recipients;
}