Fix comparison with uninitialized value in check_unifi

This commit is contained in:
Daniel Berteaud 2018-09-17 08:18:22 +02:00
parent 5337376b54
commit 21e090cd27

View File

@ -189,7 +189,7 @@ if ($unifi){
}
# For boolean, we need to convert
foreach (qw/enabled is_guest mac_filter_enabled vlan_enabled/){
$json->{$_} = ($obj->{$_} == JSON::PP::true) ? 1 : 0;
$json->{$_} = (defined $obj->{$_} and $obj->{$_} == JSON::PP::true) ? 1 : 0;
}
# Now, we need to count stations for each SSID