Skip to content

Commit b63cfb0

Browse files
committed
🐛 fix: index 예외, Lazy 예외 버그 수정
1 parent c7beb6a commit b63cfb0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

backend/src/main/java/io/f1/backend/domain/game/app/GameService.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package io.f1.backend.domain.game.app;
22

3-
import static io.f1.backend.domain.game.mapper.RoomMapper.ofPlayerEvent;
4-
import static io.f1.backend.domain.game.mapper.RoomMapper.toGameResultListResponse;
5-
import static io.f1.backend.domain.game.mapper.RoomMapper.toQuestionResultResponse;
6-
import static io.f1.backend.domain.game.mapper.RoomMapper.toQuestionStartResponse;
7-
import static io.f1.backend.domain.game.mapper.RoomMapper.toRankUpdateResponse;
3+
import static io.f1.backend.domain.game.mapper.RoomMapper.*;
84
import static io.f1.backend.domain.game.websocket.WebSocketUtils.getDestination;
95
import static io.f1.backend.domain.quiz.mapper.QuizMapper.toGameStartResponse;
106

@@ -108,6 +104,7 @@ public void onCorrectAnswer(GameCorrectAnswerEvent event) {
108104
timerService.cancelTimer(room);
109105

110106
if (!timerService.validateCurrentRound(room)) {
107+
gameEnd(room);
111108
return;
112109
}
113110

@@ -170,9 +167,9 @@ public void gameEnd(Room room) {
170167
room.updateRoomState(RoomState.WAITING);
171168

172169
messageSender.send(
173-
destination,
174-
MessageType.GAME_SETTING,
175-
toGameSettingResponse(room.getGameSetting(), room.getCurrentQuestion().getQuiz()));
170+
destination,
171+
MessageType.GAME_SETTING,
172+
toGameSettingResponse(room.getGameSetting(), quizService.getQuizWithQuestionsById(room.getGameSetting().getQuizId())));
176173
messageSender.send(destination, MessageType.ROOM_SETTING, toRoomSettingResponse(room));
177174
}
178175

0 commit comments

Comments
 (0)