Skip to content

🧩 Fix : κ²Œμ‹œλ¬Ό 등둝 / μˆ˜μ • - NPE 였λ₯˜ 처리 #228

Description

@tkv00

πŸ“„ μ„€λͺ…

μ˜€νƒ€, 잘λͺ»λœ μ„€μ •, λˆ„λ½λœ 주석 λ“± μ‚¬μ†Œν•œ μˆ˜μ •μ„ μ„€λͺ…ν•΄μ£Όμ„Έμš”

ERROR c.m.s.g.e.GlobalExceptionHandler - handleException() in GlobalExceptionHandler throw Exception : 
Cannot invoke "com.midas.shootpointer.domain.highlight.entity.HighlightEntity.getHighlightId()" because the 
return value of "com.midas.shootpointer.domain.post.entity.PostEntity.getHighlight()" is null
@PostMapping
public ResponseEntity<ApiResponse<Long>> create(
        @RequestBody PostRequest request
) {
     Member member=SecurityUtils.getCurrentMember();
     PostEntity entity=postMapper.dtoToEntity(request,member);
     return ResponseEntity.ok(ApiResponse.created(postCommandService.create(entity,member)));
}
  1. ν˜„μž¬ μœ νš¨ν•˜μ§€ μ•Šμ€ HighlightId에 λŒ€ν•΄ μœ νš¨μ„± 검증을 ν•˜κΈ° 이전에 mapper 클래슀λ₯Ό μ΄μš©ν•΄ PostEntity ν˜•νƒœλ‘œ λ§Œλ“œλŠ” λΆ€λΆ„μ—μ„œ NPE 였λ₯˜ λ°œμƒ.
  2. 같은 이유둜 κ²Œμ‹œλ¬Ό μˆ˜μ •λΆ€λΆ„λ„ 같은 였λ₯˜κ°€ λ°œμƒ.

βœ… μž‘μ—… ν•­λͺ©

ex)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    βœ… Testν…ŒμŠ€νŠΈ μ½”λ“œ μΆ”κ°€/μˆ˜μ •πŸ› BugFixκΈ°λŠ₯에 λŒ€ν•œ 버그 μˆ˜μ •πŸ§© Fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions