diff --git a/course/src/main/java/org/openedx/course/presentation/ui/CourseVideosUI.kt b/course/src/main/java/org/openedx/course/presentation/ui/CourseVideosUI.kt index f0686926f..ff20ec55d 100644 --- a/course/src/main/java/org/openedx/course/presentation/ui/CourseVideosUI.kt +++ b/course/src/main/java/org/openedx/course/presentation/ui/CourseVideosUI.kt @@ -543,7 +543,12 @@ private fun AllVideosDownloadItem( ) } if (isDownloadingAllVideos) { - val progress = 1 - downloadModelsSize.remainingSize.toFloat() / downloadModelsSize.allSize + val progress = + if (downloadModelsSize.allSize == 0L) { + 0f + } else { + 1 - downloadModelsSize.remainingSize.toFloat() / downloadModelsSize.allSize + } val animatedProgress by animateFloatAsState( targetValue = progress,