Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Avoid division by zero in ML model download progress (#14327)

laurens-pilot344d94e82f68
diff --git a/mobile/apps/photos/lib/ui/settings/ml/machine_learning_settings_page.dart b/mobile/apps/photos/lib/ui/settings/ml/machine_learning_settings_page.dart
index ea53d08e02..a1ca828490 100644
--- a/mobile/apps/photos/lib/ui/settings/ml/machine_learning_settings_page.dart
+++ b/mobile/apps/photos/lib/ui/settings/ml/machine_learning_settings_page.dart
@@ -417,7 +417,9 @@ class _ModelLoadingStateState extends State<ModelLoadingState> {
size: IconSizes.small,
),
trailing: Text(
- '${(entry.value.$1 * 100) ~/ entry.value.$2}%',
+ entry.value.$2 > 0
+ ? '${(entry.value.$1 * 100) ~/ entry.value.$2}%'
+ : '0%',
style: TextStyles.mini.copyWith(color: colors.textLight),
),
),