Check fields against null before trying to obtain their lengths.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-05-30 12:24:43 +02:00
parent 4ed39ff8d2
commit 09eb4f5dc3

View File

@@ -105,7 +105,7 @@ $(document).ready(function() {
}
// Set hostname to "N/A" if not available
if(data["name"].length < 1)
if(data["name"] && data["name"].length < 1)
{
$("td:eq(3)", row).html("N/A");
}
@@ -121,7 +121,7 @@ $(document).ready(function() {
function () { this.style.color=""; } );
// MAC + Vendor field if available
if(data["macVendor"].length > 0)
if(data["macVendor"] && data["macVendor"].length > 0)
{
$("td:eq(1)", row).html(data["hwaddr"]+"<br/>"+data["macVendor"]);
}