Commit ed6b13fc authored by Labros Papadopoulos's avatar Labros Papadopoulos
Browse files

fix null object validation

parent 0d5433e2
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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()  ) ) ){