mirror of
https://github.com/pi-hole/web.git
synced 2026-04-28 12:44:07 +01:00
Check fields against null before trying to obtain their lengths.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -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"]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user