Fix ports display (#14183)

* Fix ports with deleted device breaking all ports display

* Only filter callable based filters when required
This commit is contained in:
Tony Murray
2022-08-05 09:01:15 -05:00
committed by GitHub
parent 36e7a7793d
commit e9211d93c0
4 changed files with 16 additions and 7 deletions

View File

@@ -139,7 +139,7 @@ class Url
$text = $label;
}
$content = '<div class=list-large>' . addslashes(htmlentities($port->device->displayName() . ' - ' . $label)) . '</div>';
$content = '<div class=list-large>' . addslashes(htmlentities(optional($port->device)->displayName() . ' - ' . $label)) . '</div>';
if ($description = $port->getDescription()) {
$content .= addslashes(htmlentities($description)) . '<br />';
}
@@ -230,7 +230,7 @@ class Url
*/
public static function deviceUrl($device, $vars = [])
{
$routeParams = [is_numeric($device) ? $device : $device->device_id];
$routeParams = [($device instanceof Device) ? $device->device_id : (int) $device];
if (isset($vars['tab'])) {
$routeParams[] = $vars['tab'];
unset($vars['tab']);