mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(mobile) invalid date in exif cause timeline to crash (#1095)
This commit is contained in:
parent
1efcac0946
commit
2edbf64e69
1 changed files with 38 additions and 31 deletions
|
|
@ -1,6 +1,9 @@
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:immich_mobile/shared/models/asset.dart';
|
import 'package:immich_mobile/shared/models/asset.dart';
|
||||||
|
import 'package:logging/logging.dart';
|
||||||
|
|
||||||
|
final log = Logger('AssetGridDataStructure');
|
||||||
|
|
||||||
enum RenderAssetGridElementType {
|
enum RenderAssetGridElementType {
|
||||||
assetRow,
|
assetRow,
|
||||||
|
|
@ -64,6 +67,7 @@ List<RenderAssetGridElement> assetGroupsToRenderList(
|
||||||
DateTime? lastDate;
|
DateTime? lastDate;
|
||||||
|
|
||||||
assetGroups.forEach((groupName, assets) {
|
assetGroups.forEach((groupName, assets) {
|
||||||
|
try {
|
||||||
final date = DateTime.parse(groupName);
|
final date = DateTime.parse(groupName);
|
||||||
|
|
||||||
if (lastDate == null || lastDate!.month != date.month) {
|
if (lastDate == null || lastDate!.month != date.month) {
|
||||||
|
|
@ -104,6 +108,9 @@ List<RenderAssetGridElement> assetGroupsToRenderList(
|
||||||
}
|
}
|
||||||
|
|
||||||
lastDate = date;
|
lastDate = date;
|
||||||
|
} catch (e, stackTrace) {
|
||||||
|
log.severe(e, stackTrace);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return elements;
|
return elements;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue