Fix checking for syntax if for doesn't exist (#1769)

This commit is contained in:
Adam Mills 2018-10-14 13:04:51 -04:00 committed by Paulus Schoutsen
parent 3949b47e51
commit f1bd89fd02

View File

@ -26,7 +26,7 @@ export default class StateTrigger extends Component {
const trgFrom = trigger.from;
let trgFor = trigger.for;
if (trgFor.hours || trgFor.minutes || trgFor.seconds) {
if (trgFor && (trgFor.hours || trgFor.minutes || trgFor.seconds)) {
// If the trigger was defined using the yaml dict syntax, convert it to
// the equivalent string format
let { hours = 0, minutes = 0, seconds = 0 } = trgFor;