From ee20af51d9903285b2257a64fdce647f0a142abf Mon Sep 17 00:00:00 2001 From: Yujeong <22mallow3@gmail.com> Date: Mon, 21 Apr 2025 08:46:21 +0900 Subject: [PATCH] =?UTF-8?q?[TMO-62]=20=EC=97=AC=ED=96=89=20=EA=B1=B0?= =?UTF-8?q?=EB=A6=AC=20=EB=88=84=EB=9D=BD=EC=9C=BC=EB=A1=9C=20=EC=9D=B8?= =?UTF-8?q?=ED=95=9C=20NPE=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../swyp6_team7/profile/dto/response/ProfileViewResponse.java | 2 +- .../profile/dto/response/TargetUserProfileResponse.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/swyp/swyp6_team7/profile/dto/response/ProfileViewResponse.java b/src/main/java/swyp/swyp6_team7/profile/dto/response/ProfileViewResponse.java index b766756b..5a8d323c 100644 --- a/src/main/java/swyp/swyp6_team7/profile/dto/response/ProfileViewResponse.java +++ b/src/main/java/swyp/swyp6_team7/profile/dto/response/ProfileViewResponse.java @@ -30,7 +30,7 @@ public ProfileViewResponse(Users user, this.ageGroup = user.getUserAgeGroup().getValue(); this.userSocialTF = user.getUserSocialTF(); - this.travelDistance = user.getTotalDistance() != null ? travelDistance : 0.0; + this.travelDistance = user.getTotalDistance() != null ? user.getTotalDistance() : 0.0; this.visitedCountryCount = visitedCountryCount != null ? visitedCountryCount : 0; this.travelBadgeCount = travelBadgeCount != null ? travelBadgeCount : 0; diff --git a/src/main/java/swyp/swyp6_team7/profile/dto/response/TargetUserProfileResponse.java b/src/main/java/swyp/swyp6_team7/profile/dto/response/TargetUserProfileResponse.java index 3af0a8b9..aebed0de 100644 --- a/src/main/java/swyp/swyp6_team7/profile/dto/response/TargetUserProfileResponse.java +++ b/src/main/java/swyp/swyp6_team7/profile/dto/response/TargetUserProfileResponse.java @@ -43,7 +43,7 @@ public TargetUserProfileResponse(Users user, this.profileImageUrl = profileImageUrl; this.createdTravelCount = createdTravelCount != null ? createdTravelCount : 0; this.participatedTravelCount = participatedTravelCount != null ? participatedTravelCount : 0; - this.travelDistance = user.getTotalDistance(); + this.travelDistance = user.getTotalDistance() != null ? user.getTotalDistance() : 0.0; this.visitedCountryCount = visitedCountryCount != null ? visitedCountryCount : 0; this.travelBadgeCount = travelBadgeCount != null ? travelBadgeCount : 0; this.recentlyReported = recentlyReported != null ? recentlyReported : false;