Commit f9f646d
## #️⃣ 연관된 이슈
<!-- Ex) - #이슈번호 -->
<!-- 연관된 이슈 번호를 링크 형태로 작성하세요 -->
- #86
## 📝 작업 내용
<!-- 이번 PR/이슈에서 실제 수행한 작업 내용을 작성하세요 -->
- UserService: getCharacterType() NPE 방지, null이면 null 반환
- PerspectiveService: characterImageUrl 생성 시 characterType null 체크 (3군데)
- PerspectiveCommentService: characterImageUrl 생성 시 characterType null
체크 (2군데)
## 📝 작업 내용
### 🐛 Fix
| 내용 | 파일 |
|------|------|
| `getCharacterType()` null 체크 추가 - null이면 null 반환 | `UserService.java`
|
| `characterImageUrl` 생성 시 `characterType` null 체크 (3군데) |
`PerspectiveService.java` |
| `characterImageUrl` 생성 시 `characterType` null 체크 (2군데) |
`PerspectiveCommentService.java` |
## 📌 공유 사항
> 1. 회원가입(최초 로그인) 시 `character_type`은 NULL로 시작하며, 사용자가 프로필에서 캐릭터를 선택해야
설정됩니다.
> 2. 기존 코드는 `character_type`이 항상 non-null임을 가정하고 있어, 캐릭터 미설정 유저가 관점/댓글
API 호출 시 NPE가 발생했습니다.
> 3. `MypageService` 기존 처리 방식과 동일하게, null이면 null 그대로 응답에 내려보내도록 수정했습니다.
## ✅ 체크리스트
- [ x ] Reviewer에 팀원들을 선택했나요?
- [ x ] Assignees에 본인을 선택했나요?
- [ x ] 컨벤션에 맞는 Type을 선택했나요?
- [ x ] Development에 이슈를 연동했나요?
- [ x ] Merge 하려는 브랜치가 올바르게 설정되어 있나요?
- [ x ] 컨벤션을 지키고 있나요?
- [ x ] 로컬에서 실행했을 때 에러가 발생하지 않나요?
- [ x ] 팀원들에게 PR 링크 공유를 했나요?
## 📸 스크린샷
> EC2 서버 로그에서 확인된 NPE:
> `Cannot invoke "CharacterType.name()" because the return value of
"UserProfile.getCharacterType()" is null`
> `at UserService.findSummaryById(UserService.java:80)`
## 💬 리뷰 요구사항
> 1. 현재 캐릭터 미설정 유저에 대해 `characterType`, `characterImageUrl` 모두 null로
내려보내는 중
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 11c4f99 commit f9f646d
3 files changed
Lines changed: 17 additions & 11 deletions
File tree
- src/main/java/com/swyp/picke/domain
- perspective/service
- user/service
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | | - | |
100 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
127 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
174 | | - | |
175 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
0 commit comments