-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] 개별 프로필 조회 API 구현 #139
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다!
return new TripParticipantProfileResponse( | ||
user.getName(), | ||
user.getIntro(), | ||
validatedResult, | ||
participant.getStyleA(), | ||
participant.getStyleB(), | ||
participant.getStyleC(), | ||
participant.getStyleD(), | ||
participant.getStyleE(), | ||
isOwner | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builder 어노테이션을 적용해봐도 좋을 것 같습니다~
private int getvalidatedResult(User user) { | ||
try { | ||
return user.getResult().getNumResult(); | ||
} catch (NullPointerException e) { | ||
return -1; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변경해보니 response builder에서 user.getResult().getNumResult()를 사용하는데 getResult() 자체가 null 이기 때문에 getNumResult()를 꺼내오면 NPE가 발생하는것으로 확인됩니다. null을 그대로 반환하려면 다시 user.getResult()를 null인지 아닌지 확인하는 메서드가 필요한데 이 메서드를 추가해서 null을 반환하는 것으로 변경하는게 나을까요?! 좋은 의견있으면 알려주세요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 잘못 이해했었네요! 저도 조금 더 고민이 필요할 것 같습니다. 우선 2차 스프린트 기간 내에 API가 배포되어야 해서 현재 기능적인 문제는 없으니 현재 PR 머지 후 이슈를 새롭게 생성해서 리팩터링을 진행해 보면 좋을 것 같습니다. 같이 고민해 보겠습니다!
Related Issue 📌
close #134
Description ✔️