diff --git a/html/includes/dev-overview-data.inc.php b/html/includes/dev-overview-data.inc.php index a4e0cf0c7c..b0b7702c10 100644 --- a/html/includes/dev-overview-data.inc.php +++ b/html/includes/dev-overview-data.inc.php @@ -116,7 +116,8 @@ if ($device['location_id']) { $maps_engine = $maps_api ? Config::get('geoloc.engine') : ''; $location = Location::find($device['location_id']); - $location_coords = $location->coordinatesValid() ? $location->lat . ', ' . $location->lng : 'N/A'; + $location_valid = $location && $location->coordinatesValid(); + $location_coords = $location_valid ? $location->lat . ', ' . $location->lng : 'N/A'; echo '
@@ -128,7 +129,7 @@ if ($device['location_id']) {
' . $location_coords . '
'; echo ''; - if ($location->coordinatesValid()) { + if ($location_valid) { echo ' Map'; } echo '