From 60fd8ffbb53bbf4bcc9e7669563fd6b766bdf435 Mon Sep 17 00:00:00 2001 From: DongGeon0908 Date: Fri, 27 Sep 2024 10:06:00 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B7=B8=EB=A3=B9=20=EC=A0=84=EC=B2=B4?= =?UTF-8?q?=20=ED=8F=89=EA=B7=A0=20=EC=8A=A4=EC=BD=94=EC=96=B4=20=EB=B0=8F?= =?UTF-8?q?=20=EB=82=B4=20=EC=8A=A4=EC=BD=94=EC=96=B4=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20=EC=A0=9C=EA=B3=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hero/alignlab/domain/group/application/GroupFacade.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/hero/alignlab/domain/group/application/GroupFacade.kt b/src/main/kotlin/com/hero/alignlab/domain/group/application/GroupFacade.kt index 6065c5b..638191e 100644 --- a/src/main/kotlin/com/hero/alignlab/domain/group/application/GroupFacade.kt +++ b/src/main/kotlin/com/hero/alignlab/domain/group/application/GroupFacade.kt @@ -267,7 +267,10 @@ class GroupFacade( score = groupUserScore.score ?: return@mapNotNull null, ) } - val avgGroupUserScore = (ranks.sumOf { it.score } / ranks.size) + val avgGroupUserScore = when (ranks.isNotEmpty()) { + true -> (ranks.sumOf { it.score } / ranks.size) + false -> null + } val myScore = ranks.firstOrNull { it.groupUserId == groupUser.id }?.score return GetGroupRanksResponse(