mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 02:48:37 +00:00
Move device exist check to prevent error (#12232)
This commit is contained in:
parent
6416de5bd3
commit
0b6231be1b
@ -60,12 +60,13 @@ class DeviceController extends Controller
|
||||
$device = str_replace('device=', '', $device);
|
||||
$device = is_numeric($device) ? DeviceCache::get($device) : DeviceCache::getByHostname($device);
|
||||
$device_id = $device->device_id;
|
||||
DeviceCache::setPrimary($device_id);
|
||||
|
||||
if (! $device->exists) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
DeviceCache::setPrimary($device_id);
|
||||
|
||||
$current_tab = str_replace('tab=', '', $current_tab);
|
||||
$current_tab = array_key_exists($current_tab, $this->tabs) ? $current_tab : 'overview';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user