Commit 0ad14370 by Tuomas Riihimäki

Permission and nullpointer fixes

1 parent 2b2d50ee
......@@ -138,7 +138,7 @@ public class EventBean implements EventBeanLocal {
@Override
@RolesAllowed({ SpecialPermission.S_SUPERADMIN, EventPermission.S_MANAGE_EVENT })
public LanEvent mergeChanges(LanEvent event) {
if (!permbean.hasPermission(SpecialPermission.SUPERADMIN) && getCurrentEvent().equals(event)) {
if (!permbean.hasPermission(SpecialPermission.SUPERADMIN) && !getCurrentEvent().equals(event)) {
throw new EJBAccessException("Trying to save another event.");
}
return eventFacade.merge(event);
......@@ -187,8 +187,7 @@ public class EventBean implements EventBeanLocal {
public LanEventProperty getProperty(LanEventPropertyKey property) {
return eventPropertyFacade.find(getCurrentEvent(), property);
}
@Override
public long getPropertyLong(LanEventPropertyKey property)
{
......@@ -201,8 +200,6 @@ public class EventBean implements EventBeanLocal {
}
return ret;
}
@Override
public String getPropertyString(LanEventPropertyKey property)
......
......@@ -265,7 +265,7 @@ public class PlaceMap extends HttpServlet {
color = RESERVED_COLOR;
// logger.debug("Setting place Reserved {}", p);
} else if (p.getProduct().getColor() != null && !p.getProduct().getColor().isEmpty()) {
} else if (p.getProduct() != null && p.getProduct() != null && p.getProduct().getColor() != null && !p.getProduct().getColor().isEmpty()) {
try {
color = Color.decode(p.getProduct().getColor());
......@@ -273,8 +273,8 @@ public class PlaceMap extends HttpServlet {
logger.error("Cannot convert string {} to color.", p.getProduct().getColor());
}
} else {
// too much debugging -TKjne
// logger.debug("Nothing special for this place. Color should be default.");
// too much debugging -TKjne
// logger.debug("Nothing special for this place. Color should be default.");
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!