From 1ded31491aba2a29784b733287e8591f5b26b5ff Mon Sep 17 00:00:00 2001 From: Kima Date: Thu, 28 Dec 2023 23:50:20 +0100 Subject: [PATCH] fixed db error --- filcnaplo/lib/database/query.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/filcnaplo/lib/database/query.dart b/filcnaplo/lib/database/query.dart index 9115e41..1905d57 100644 --- a/filcnaplo/lib/database/query.dart +++ b/filcnaplo/lib/database/query.dart @@ -129,8 +129,17 @@ class UserDatabaseQuery { String? recipientsJson = userData.elementAt(0)["recipients"] as String?; if (recipientsJson == null) return []; List 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; }