handle row.power.power being NULL

fixes this error, since device_port_power.power can be null:
Argument "" isn't numeric in numeric gt (>) at /home/netdisco/perl5/lib/perl5/auto/share/dist/App-Netdisco/views/ajax/device/ports.tt line 251.

currently only seen on cisco sb switches, which do have all other columns filled in
      ip       | port | module | admin |   status   | class  | power
---------------+------+--------+-------+------------+--------+-------
 10.40.254.150 | fa2  |      1 | true  | otherFault | class3 |
 10.40.254.150 | fa16 |      1 | true  | searching  | class3 |
 10.40.254.150 | fa3  |      1 | true  | searching  | class3 |
...
This commit is contained in:
nick n
2019-07-19 04:16:06 +02:00
committed by GitHub
parent 5b9761cbae
commit d1a1235c85

View File

@@ -244,7 +244,7 @@
<i class="icon-off nd_power-on"></i>
[% END %]
<span>
[% IF row.power.power > 0 %]
[% IF row.power.power AND row.power.power > 0 %]
[% row.power.power | html_entity %]&nbsp;mW
[% ELSE %]
([% row.power.status | html_entity %])