diff --git a/core/src/main/kotlin/timetables/service/TimetableThemeService.kt b/core/src/main/kotlin/timetables/service/TimetableThemeService.kt index b224ccfa..9b43eef3 100644 --- a/core/src/main/kotlin/timetables/service/TimetableThemeService.kt +++ b/core/src/main/kotlin/timetables/service/TimetableThemeService.kt @@ -238,7 +238,8 @@ class TimetableThemeServiceImpl( val theme = getTheme(timetable.userId, timetable.themeId) val alreadyUsedColors = timetable.lectures.map { requireNotNull(it.color) } - val colorToCount = requireNotNull(theme.colors).associateWith { color -> alreadyUsedColors.count { it == color } } + val colors = requireNotNull(theme.colors) { "theme.colors 가 null - userId: ${timetable.userId}, timetableId: ${timetable.id}, themeId: ${theme.id}" } + val colorToCount = colors.associateWith { color -> alreadyUsedColors.count { it == color } } val minCount = colorToCount.minOf { it.value } 0 to colorToCount.entries.filter { (_, count) -> count == minCount }.map { it.key }.random()