From ed6b13fc2cc4b4c930492591fd4014ecbf46b55f Mon Sep 17 00:00:00 2001 From: lpapadopoulos <lpapadopoulos@ubitech.eu> Date: Wed, 29 May 2024 16:12:51 +0300 Subject: [PATCH] fix null object validation --- .../tmf/gsm674/api/GeographicSiteManagementApiController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/etsi/osl/tmf/gsm674/api/GeographicSiteManagementApiController.java b/src/main/java/org/etsi/osl/tmf/gsm674/api/GeographicSiteManagementApiController.java index ea1b983..76faa05 100644 --- a/src/main/java/org/etsi/osl/tmf/gsm674/api/GeographicSiteManagementApiController.java +++ b/src/main/java/org/etsi/osl/tmf/gsm674/api/GeographicSiteManagementApiController.java @@ -69,7 +69,8 @@ public class GeographicSiteManagementApiController implements GeographicSiteMana Individual ind = individualRepoService.findByUsername(principal.getName()); GeographicSite gs= geographicSiteManagementService.findGeographicSiteByRelatedPartyId(ind.getId()); - if (gs==null) gs =new GeographicSite(); + if (gs==null) { + gs =new GeographicSite(); GeographicSubAddressValue geographicSubAddressValue=new GeographicSubAddressValue(); GeographicAddressValue geographicAddressValue=new GeographicAddressValue(); geographicAddressValue.setGeographicSubAddress(geographicSubAddressValue); @@ -77,6 +78,7 @@ public class GeographicSiteManagementApiController implements GeographicSiteMana List<PlaceRefOrValue> placeRefOrValues=new ArrayList<>(); placeRefOrValues.add(placeRefOrValue); gs.setPlace(placeRefOrValues); + } return new ResponseEntity<GeographicSite>(gs,HttpStatus.OK); } else if ( authentication.getAuthorities().contains( new SimpleGrantedAuthority( UserRoleType.ROLE_ADMIN.getValue() ) ) ){ -- GitLab