From c29a52105c02bb9752950df4619c2de5b7053469 Mon Sep 17 00:00:00 2001 From: adz Date: Wed, 26 Jun 2024 19:00:10 +0200 Subject: [PATCH] Make sightings on used for nullable --- packages/app/lib/models/used_for.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/app/lib/models/used_for.dart b/packages/app/lib/models/used_for.dart index 5b0c4912..70cee4d7 100644 --- a/packages/app/lib/models/used_for.dart +++ b/packages/app/lib/models/used_for.dart @@ -12,7 +12,7 @@ class UsedFor { final DocumentId id; DocumentViewId viewId; - DocumentId sighting; + DocumentId? sighting; String usedFor; UsedFor( @@ -25,8 +25,9 @@ class UsedFor { return UsedFor( id: result['meta']['documentId'] as DocumentId, viewId: result['meta']['viewId'] as DocumentViewId, - sighting: - result['fields']['sighting']['meta']['documentId'] as DocumentId, + sighting: result['fields']['sighting'] != null + ? result['fields']['sighting']['meta']['documentId'] as DocumentId + : null, usedFor: result['fields']['used_for'] as String); }