Skip to content
Snippets Groups Projects
Commit 7ee2b8d6 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Avoiding Exception on non-existing Organization

parent 6d200b0c
Branches
Tags
No related merge requests found
......@@ -252,8 +252,14 @@ public class PointOfInterestBean {
* @return
*/
public List<PointOfInterestWeatherStation> getWeatherstationsForOrganization(Organization organization, Boolean active) {
if(organization == null)
{
return new ArrayList<>();
}
// Avoid nulls
active = active == null ? true : active;
List<PointOfInterestWeatherStation> retVal = em.createNamedQuery("PointOfInterestWeatherStation.findByActivityAndOrganizationId", PointOfInterestWeatherStation.class)
.setParameter("organizationId", organization)
.setParameter("active", active)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment