Skip to content

Commit 614c586

Browse files
farhan-arshad-devdixidroid
authored andcommitted
fix: crash current must not be NaN during bulk download (#63)
- Add validation to ensure that the progress value is not NaN. fixes: LEARNER-10248
1 parent b892560 commit 614c586

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

course/src/main/java/org/openedx/course/presentation/ui/CourseVideosUI.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,12 @@ private fun AllVideosDownloadItem(
543543
)
544544
}
545545
if (isDownloadingAllVideos) {
546-
val progress = 1 - downloadModelsSize.remainingSize.toFloat() / downloadModelsSize.allSize
546+
val progress =
547+
if (downloadModelsSize.allSize == 0L) {
548+
0f
549+
} else {
550+
1 - downloadModelsSize.remainingSize.toFloat() / downloadModelsSize.allSize
551+
}
547552

548553
val animatedProgress by animateFloatAsState(
549554
targetValue = progress,

0 commit comments

Comments
 (0)