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

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

* log error
This commit is contained in:
Alex 2024-09-21 07:29:07 +07:00 committed by GitHub
parent 5a1a841365
commit 14169d310a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;