Only check "printer-state-reasons" if it exists

This commit is contained in:
Anton Thomasson 2021-05-25 19:56:38 +02:00
parent 0bd35d647c
commit 8ad40f78a2

View file

@ -361,6 +361,8 @@ function isWaringState(printer)
return true;
}
if(printer.attrs.hasOwnProperty("printer-state-reasons"))
{
for(var i in printer.attrs["printer-state-reasons"].value)
{
var value = printer.attrs["printer-state-reasons"].value[i];
@ -369,6 +371,7 @@ function isWaringState(printer)
return true;
}
}
}
return false;
}