Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] fix panic in file properties logic

Priyanshu Dangaree041958a66d7
diff --git a/mobile/apps/photos/lib/ui/viewer/file_details/file_properties_item_widget.dart b/mobile/apps/photos/lib/ui/viewer/file_details/file_properties_item_widget.dart
index d21b60359b..cad3793331 100644
--- a/mobile/apps/photos/lib/ui/viewer/file_details/file_properties_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file_details/file_properties_item_widget.dart
@@ -105,11 +105,11 @@ class _FilePropertiesItemWidgetState extends State<FilePropertiesItemWidget> {
subSectionWidgets.add(Text(formatBytes(fileSize), style: textStyle));
}
- if ((widget.file.fileType == FileType.video) &&
- (widget.file.localID != null || widget.file.duration != 0)) {
- if (widget.file.duration != 0) {
+ if (widget.file.fileType == FileType.video) {
+ final duration = widget.file.duration ?? 0;
+ if (duration != 0) {
subSectionWidgets.add(
- Text(secondsToHHMMSS(widget.file.duration!), style: textStyle),
+ Text(secondsToHHMMSS(duration), style: textStyle),
);
} else {
final asset = await widget.file.getAsset;