From a7e25bf609e7870def8c3e904dc4ea88fefe9f4d Mon Sep 17 00:00:00 2001 From: BGuga Date: Tue, 15 Aug 2023 17:50:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Member=20=EC=9D=98=20profileImage=20?= =?UTF-8?q?=EA=B0=80=20null=20=EC=9D=B8=20=EA=B2=BD=EC=9A=B0=EC=9D=98=20nu?= =?UTF-8?q?ll=20check=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/festago/domain/Member.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/com/festago/domain/Member.java b/backend/src/main/java/com/festago/domain/Member.java index f67e34cbc..4646f79bb 100644 --- a/backend/src/main/java/com/festago/domain/Member.java +++ b/backend/src/main/java/com/festago/domain/Member.java @@ -18,7 +18,7 @@ public class Member extends BaseTimeEntity { private static final String DEFAULT_IMAGE_URL = "https://festa-go.site/images/default-profile.png"; - + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @@ -52,7 +52,7 @@ public Member(String socialId, SocialType socialType, String nickname, String pr } public Member(Long id, String socialId, SocialType socialType, String nickname, String profileImage) { - validate(socialId, socialType, nickname, profileImage); + validate(socialId, socialType, nickname); this.id = id; this.socialId = socialId; this.socialType = socialType; @@ -60,16 +60,15 @@ public Member(Long id, String socialId, SocialType socialType, String nickname, this.profileImage = (profileImage != null) ? profileImage : DEFAULT_IMAGE_URL; } - private void validate(String socialId, SocialType socialType, String nickname, String profileImage) { - checkNotNull(socialId, socialType, nickname, profileImage); + private void validate(String socialId, SocialType socialType, String nickname) { + checkNotNull(socialId, socialType, nickname); checkLength(socialId, nickname, profileImage); } - private void checkNotNull(String socialId, SocialType socialType, String nickname, String profileImage) { + private void checkNotNull(String socialId, SocialType socialType, String nickname) { if (Objects.isNull(socialId) || Objects.isNull(socialType) || - Objects.isNull(nickname) || - Objects.isNull(profileImage)) { + Objects.isNull(nickname)) { throw new IllegalArgumentException("Member 는 허용되지 않은 null 값으로 생성할 수 없습니다."); } }