mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix world map when location has been deleted that a device still references (#9997)
This commit is contained in:
@@ -63,7 +63,7 @@ class WorldMapController extends WidgetController
|
||||
->get()
|
||||
->filter(function ($device) use ($status) {
|
||||
/** @var Device $device */
|
||||
if (!($device->location_id && $device->location->coordinatesValid())) {
|
||||
if (!($device->location_id && $device->location && $device->location->coordinatesValid())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -113,7 +113,7 @@ if ($device['location_id']) {
|
||||
$maps_engine = $maps_api ? Config::get('geoloc.engine') : '';
|
||||
|
||||
$location = Location::find($device['location_id']);
|
||||
$location_valid = $location && $location->coordinatesValid();
|
||||
$location_valid = ($location && $location->coordinatesValid());
|
||||
$location_coords = $location_valid ? $location->lat . ', ' . $location->lng : 'N/A';
|
||||
|
||||
echo '
|
||||
|
Reference in New Issue
Block a user