diff --git a/src/main/java/mafia/mafiatogether/game/aspect/SseService.java b/src/main/java/mafia/mafiatogether/game/aspect/SseService.java index e86b9c28..79c7b146 100644 --- a/src/main/java/mafia/mafiatogether/game/aspect/SseService.java +++ b/src/main/java/mafia/mafiatogether/game/aspect/SseService.java @@ -4,6 +4,7 @@ import mafia.mafiatogether.common.annotation.PlayerInfo; import mafia.mafiatogether.common.exception.AuthException; import mafia.mafiatogether.common.exception.ExceptionCode; +import mafia.mafiatogether.common.resolver.PlayerInfoDto; import mafia.mafiatogether.game.application.dto.response.GameStatusResponse; import mafia.mafiatogether.game.domain.Game; import mafia.mafiatogether.game.domain.GameRepository; @@ -45,8 +46,9 @@ public ResponseEntity subscribe(final ProceedingJoinPoint joinPoint) String[] codeAndName = new String[2]; for (int i = 0; i < parameterAnnotations.length; i++) { if (hasPlayerInfo(parameterAnnotations[i])) { - codeAndName[0] = args[i].toString(); - codeAndName[1] = args[i].toString(); + PlayerInfoDto playerInfoDto = (PlayerInfoDto) args[i]; + codeAndName[0] = playerInfoDto.code(); + codeAndName[1] = playerInfoDto.name(); break; } } diff --git a/src/main/java/mafia/mafiatogether/job/domain/JobTarget.java b/src/main/java/mafia/mafiatogether/job/domain/JobTarget.java index 6dbe28c0..c17fdc57 100644 --- a/src/main/java/mafia/mafiatogether/job/domain/JobTarget.java +++ b/src/main/java/mafia/mafiatogether/job/domain/JobTarget.java @@ -25,7 +25,7 @@ public JobTarget() { public String findTarget() { final String mafiaTarget = findJobTargetBy(JobType.MAFIA); final String doctorTarget = findJobTargetBy(JobType.DOCTOR); - if (mafiaTarget.equals(doctorTarget)) { + if (mafiaTarget == null || mafiaTarget.equals(doctorTarget)) { return null; } return mafiaTarget;