Add missing check
This commit is contained in:
parent
3e53933911
commit
8e6238c014
|
@ -21,7 +21,7 @@ function Schedule() {
|
|||
this.currentEvent = function() {
|
||||
var latestEvent = _.last(this.pastEvents());
|
||||
var nextEvent = this.nextEvent();
|
||||
if (typeof nextEvent != 'undefined' && (latestEvent.displayNext || moment(nextEvent.startTime).subtract('minutes', 10).isAfter(moment()))) {
|
||||
if (typeof nextEvent != 'undefined' && typeof latestEvent != 'undefined' && (latestEvent.displayNext || moment(nextEvent.startTime).subtract('minutes', 10).isAfter(moment()))) {
|
||||
return latestEvent;
|
||||
} else {
|
||||
return undefined;
|
||||
|
|
Loading…
Reference in New Issue