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: dto의 phone에서 발생 가능한 NPE 제거 #104

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ public record MemberFindAllResponse(
String nickname) {

public static MemberFindAllResponse of(Member member) {
String phone = null;
if (member.getPhone() != null) {
phone = String.format(
"%s-%s-%s",
member.getPhone().substring(0, 3),
member.getPhone().substring(3, 7),
member.getPhone().substring(7));
}
return new MemberFindAllResponse(
member.getId(),
member.getStudentId(),
member.getName(),
String.format(
"%s-%s-%s",
member.getPhone().substring(0, 3),
member.getPhone().substring(3, 7),
member.getPhone().substring(7)),
phone,
member.getDepartment(),
member.getEmail(),
member.getDiscordUsername(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ public record MemberPendingFindAllResponse(
Requirement requirement) {

public static MemberPendingFindAllResponse of(Member member) {
String phone = null;
if (member.getPhone() != null) {
phone = String.format(
"%s-%s-%s",
member.getPhone().substring(0, 3),
member.getPhone().substring(3, 7),
member.getPhone().substring(7));
}
return new MemberPendingFindAllResponse(
member.getId(),
member.getStudentId(),
member.getName(),
String.format(
"%s-%s-%s",
member.getPhone().substring(0, 3),
member.getPhone().substring(3, 7),
member.getPhone().substring(7)),
phone,
member.getDepartment(),
member.getEmail(),
member.getDiscordUsername(),
Expand Down
Loading