Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Null safety check

laurenspriem8e0a5e44190c
diff --git a/mobile/lib/models/base_location.dart b/mobile/lib/models/base_location.dart
index b7834fd089..7bdbb7eaec 100644
--- a/mobile/lib/models/base_location.dart
+++ b/mobile/lib/models/base_location.dart
@@ -41,7 +41,10 @@ class BaseLocation {
Map<int, EnteFile> filesMap,
) {
return BaseLocation(
- (json['fileIDs'] as List).map((e) => filesMap[e]!).toList(),
+ (json['fileIDs'] as List)
+ .where((uploadID) => filesMap[uploadID] != null)
+ .map((uploadID) => filesMap[uploadID]!)
+ .toList(),
Location(
latitude: json['location']['latitude'],
longitude: json['location']['longitude'],