Skip to content

Commit 17dc5b2

Browse files
committed
🐛 달린 시간 0초일 때 NaN 예외 처리
1 parent 1bbce31 commit 17dc5b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

presentation/src/main/java/com/whyranoid/presentation/running/RunningDataManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class RunningDataManager @Inject constructor() {
8484
distance
8585
)
8686
val newTotalDistance = prevRunningData.totalDistance + distance.first()
87-
val newPace = newTotalDistance / newRunningTime
87+
val newPace = if (newRunningTime == 0) 0.0 else newTotalDistance / newRunningTime
8888
val newRunningPositionList =
8989
prevRunningData.runningPositionList.toList().map { it.toMutableList() }
9090
.also { it[it.lastIndex].add(runningPosition) }

0 commit comments

Comments
 (0)