Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] fix usage of latLong API from photo_manager 3.10.0

Priyanshu Dangaree1834e610632
diff --git a/mobile/apps/photos/lib/module/upload/upload_data.dart b/mobile/apps/photos/lib/module/upload/upload_data.dart
index 99002ff1cd..7a7d964747 100644
--- a/mobile/apps/photos/lib/module/upload/upload_data.dart
+++ b/mobile/apps/photos/lib/module/upload/upload_data.dart
@@ -275,8 +275,8 @@ Future<void> _decorateEnteFileData(
(file.location!.latitude == 0 && file.location!.longitude == 0)) {
final latLong = await asset.latlngAsync();
file.location = Location(
- latitude: latLong.latitude,
- longitude: latLong.longitude,
+ latitude: latLong?.latitude,
+ longitude: latLong?.longitude,
);
}
await updateLocationFromEmbeddedMetadata(file, sourceFile, exifData);
diff --git a/mobile/apps/photos/lib/services/sync/offline_import_metadata_service.dart b/mobile/apps/photos/lib/services/sync/offline_import_metadata_service.dart
index 81ef53a727..1a9506e159 100644
--- a/mobile/apps/photos/lib/services/sync/offline_import_metadata_service.dart
+++ b/mobile/apps/photos/lib/services/sync/offline_import_metadata_service.dart
@@ -152,8 +152,8 @@ class OfflineImportMetadataService {
if (asset != null) {
final latLong = await asset.latlngAsync();
file.location = Location(
- latitude: latLong.latitude,
- longitude: latLong.longitude,
+ latitude: latLong?.latitude,
+ longitude: latLong?.longitude,
);
}
}
diff --git a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart
index 1c3f69a8eb..42453be46d 100644
--- a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart
+++ b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart
@@ -135,8 +135,8 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
if (assetEntity != null) {
final latLong = await assetEntity.latlngAsync();
newFile.location = Location(
- latitude: latLong.latitude,
- longitude: latLong.longitude,
+ latitude: latLong?.latitude,
+ longitude: latLong?.longitude,
);
}
}
diff --git a/mobile/apps/photos/lib/ui/tools/editor/video_editor_page.dart b/mobile/apps/photos/lib/ui/tools/editor/video_editor_page.dart
index 9feca546d1..a2eafea875 100644
--- a/mobile/apps/photos/lib/ui/tools/editor/video_editor_page.dart
+++ b/mobile/apps/photos/lib/ui/tools/editor/video_editor_page.dart
@@ -579,8 +579,8 @@ class _VideoEditorPageState extends State<VideoEditorPage> {
if (assetEntity != null) {
final latLong = await assetEntity.latlngAsync();
newFile.location = Location(
- latitude: latLong.latitude,
- longitude: latLong.longitude,
+ latitude: latLong?.latitude,
+ longitude: latLong?.longitude,
);
}
}