Handle failure to retrieve the alarm by Id by returning null instead of a NullPointerException

This commit is contained in:
Craig Bryant 2014-05-05 21:15:18 -06:00
parent 7c6394b1f8
commit 6776df2319
1 changed files with 2 additions and 0 deletions

View File

@ -83,6 +83,8 @@ public class AlarmDAOImpl implements AlarmDAO {
.bind("id", id)
.map(new BeanMapper<Alarm>(Alarm.class))
.first();
if (alarm == null)
return alarm;
alarm.setSubAlarms(subAlarmsForRows(
h,