Fix links to non-existent devices (#12680)

Was throwing an exception before instead of returning an empty string
This commit is contained in:
Tony Murray 2021-03-30 14:47:11 -05:00 committed by GitHub
parent 10cf97e581
commit f84591a1c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ class Url
*/
public static function deviceLink($device, $text = null, $vars = [], $start = 0, $end = 0, $escape_text = 1, $overlib = 1)
{
if (is_null($device)) {
if (! $device instanceof Device || ! $device->hostname) {
return '';
}