Skip to content
Snippets Groups Projects
Commit ed6b13fc authored by Labros Papadopoulos's avatar Labros Papadopoulos
Browse files

fix null object validation

parent 0d5433e2
No related branches found
No related tags found
1 merge request!25Tmf 674 feature
Pipeline #6263 passed
......@@ -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() ) ) ){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment