Use default schedule for end of time condition

This commit is contained in:
M66B 2019-08-29 16:03:01 +02:00
parent df845e9c01
commit a7d59ba3cd
1 changed files with 1 additions and 4 deletions

View File

@ -351,10 +351,7 @@ public class EntityRule {
JSONObject jcondition = new JSONObject(condition);
JSONObject jschedule = jcondition.optJSONObject("schedule");
if (jschedule == null)
throw new IllegalArgumentException("Rule snooze schedule not found");
int end = jschedule.optInt("end", 0);
int end = (jschedule == null ? 0 : jschedule.optInt("end", 0));
Calendar cal = getRelativeCalendar(end, message.received);
wakeup = cal.getTimeInMillis() + duration * 3600 * 1000L;
} else