Provide better logging when there is no data passwed to setAlarmCues

This commit is contained in:
Isaac Connor 2022-01-10 12:49:13 -05:00
parent 701045393c
commit 3f7e4c67a0
1 changed files with 9 additions and 3 deletions

View File

@ -88,9 +88,15 @@ function initialAlarmCues(eventId) {
}
function setAlarmCues(data) {
cueFrames = data.frames;
alarmSpans = renderAlarmCues(vid ? $j("#videoobj") : $j("#evtStream"));//use videojs width or zms width
$j(".alarmCue").html(alarmSpans);
if (!data) {
Error('No data in setAlarmCues for event ' + eventData.Id);
} else if (!data.frames) {
Error('No data.frames in setAlarmCues for event ' + eventData.Id);
} else {
cueFrames = data.frames;
alarmSpans = renderAlarmCues(vid ? $j("#videoobj") : $j("#evtStream"));//use videojs width or zms width
$j(".alarmCue").html(alarmSpans);
}
}
function renderAlarmCues(containerEl) {