Skip to content

High performance self-hosted photo and video management solution.

fix(mobile): fix uncaught error in getting file cause hashing procses to be aborted entirely (#12826)

Alex14169d310a35
diff --git a/mobile/lib/services/hash.service.dart b/mobile/lib/services/hash.service.dart
index 2ec545453f..94d680972f 100644
--- a/mobile/lib/services/hash.service.dart
+++ b/mobile/lib/services/hash.service.dart
@@ -65,7 +65,19 @@ class HashService {
if (hashes[i] != null) {
continue;
}
- final file = await assets[i].local!.originFile;
+
+ File? file;
+
+ try {
+ file = await assets[i].local!.originFile;
+ } catch (error, stackTrace) {
+ _log.warning(
+ "Error getting file to hash for asset ${assets[i].localId}, name: ${assets[i].fileName}, created on: ${assets[i].fileCreatedAt}, skipping",
+ error,
+ stackTrace,
+ );
+ }
+
if (file == null) {
final fileName = assets[i].fileName;