diff --git a/src/main/java/org/poolc/api/post/controller/PostController.java b/src/main/java/org/poolc/api/post/controller/PostController.java index 2c3d7d3f..93ad6ca0 100644 --- a/src/main/java/org/poolc/api/post/controller/PostController.java +++ b/src/main/java/org/poolc/api/post/controller/PostController.java @@ -40,7 +40,7 @@ public ResponseEntity registerPost(@AuthenticationPrincipal Member member, @GetMapping("/post/{postId}") public ResponseEntity viewPost(@AuthenticationPrincipal Member member, @PathVariable Long postId) { Post post = postService.findById(member, postId); - PostResponse response = PostResponse.of(post, scrapService.isScrap(member.getLoginID(),postId)); + PostResponse response = PostResponse.of(post, (member==null)?scrapService.isScrap(member.getLoginID(),postId):false); return ResponseEntity.status(HttpStatus.OK).body(response); }