Skip to content

Commit

Permalink
Only check "printer-state-reasons" if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed May 25, 2021
1 parent 0bd35d6 commit 8ad40f7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions qml/pages/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,15 @@ function isWaringState(printer)
return true;
}

for(var i in printer.attrs["printer-state-reasons"].value)
if(printer.attrs.hasOwnProperty("printer-state-reasons"))
{
var value = printer.attrs["printer-state-reasons"].value[i];
if(value != "none" && !(endsWith("-report", value)))
for(var i in printer.attrs["printer-state-reasons"].value)
{
return true;
var value = printer.attrs["printer-state-reasons"].value[i];
if(value != "none" && !(endsWith("-report", value)))
{
return true;
}
}
}
return false;
Expand Down

0 comments on commit 8ad40f7

Please sign in to comment.