Skip to content
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

[fix] #196 - promotion 조회 로직 수정 #197

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Conversation

hyerinhwang-sailin
Copy link
Collaborator

Related issue 🛠

Work Description ✏️

performanceId가 null인 promotion이 db에 삽입됐을 때 홈페이지 조회가 안되는 이슈가 있었습니다.
PerformanceService의 getPromotions 로직에서 performanceId가 null인 경우를 고려하지 않아 발생한 이슈였기 때문에 performanceId가 null이 아닌 경우에만 promotion.getPerformance().getId()로 performanceId를 조회하는 로직으로 수정했습니다.

Trouble Shooting ⚽️

Related ScreenShot 📷

image
performanceId가 null인 promotionId 9번의 promotion을 포함한 promotionList가 정상적으로 조회되며, performanceList도 같이 잘 조회되는 것을 확인했습니다.

Uncompleted Tasks 😅

To Reviewers 📢

Comment on lines +223 to +226
Long performanceId = null;
if (promotion.getPerformance() != null) {
performanceId = promotion.getPerformance().getId();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확실히 getPerformance()가 null일 때, getId()를 하게 되면 NullPointerException이 발생해 500에러가 발생하는 것 같습니다.

이를 promotion.getPerformance()시 null이 아닐때만 getId()를 하도록 하신 점 너무 잘하신 것 같습니다!
고생하였습니다~

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다ㅎㅎ

@hyerinhwang-sailin hyerinhwang-sailin merged commit e327ad4 into develop Aug 29, 2024
1 check passed
@hoonyworld hoonyworld deleted the fix/#196 branch August 31, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fix] promotion 조회 로직 수정
2 participants