Skip to content

Commit

Permalink
Fix : null 체크
Browse files Browse the repository at this point in the history
  • Loading branch information
mmihye committed Oct 3, 2024
1 parent f32acad commit 182dc63
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ else if (place.getCategory().equals("A05"))
String place_tel=null;
String place_homepage=null;

if(!place.getTel().isBlank())
if(place.getId() != null && !place.getTel().isBlank())
place_tel = place.getTel();

if(!place.getHomepage().isBlank())
if(place.getHomepage() != null && !place.getHomepage().isBlank())
place_homepage = place.getHomepage();



return new PlaceDetailGuestRes(place.getId(), place.getName(), place.getFirstImg(), place.getAddress(), cat, place.getOverview(), place.getMapX().toString(), place.getMapY().toString(),
place_tel, place_homepage,bookmarkNum, disability, subDisability, reviewList);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ else if (place.getCategory().equals("A05"))
String place_tel=null;
String place_homepage=null;

if(!place.getTel().isBlank())
if(place.getId() != null && !place.getTel().isBlank())
place_tel = place.getTel();

if(!place.getHomepage().isBlank())
if(place.getHomepage() != null && !place.getHomepage().isBlank())
place_homepage = place.getHomepage();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public PlaceDetailRes getPlaceDetail(Member member, Long placeId){
Boolean isMark = false;

Place place = getPlace(placeId);
System.out.println(place.getId());
Long myPlaceReviewId;

List<PlaceBookmark> placeBookmarkList = placeBookmarkRepository.findAllByPlaceAndMember(place,member);
Expand Down

0 comments on commit 182dc63

Please sign in to comment.