mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Check that model name exists before trying to display it
I don’t know why this would ever trigger, but a user in Gitter complained earlier today, so… ¯\_(ツ)_/¯
This commit is contained in:
parent
bbda0dc3b4
commit
715da63581
|
@ -184,7 +184,7 @@ class Asset extends Depreciable
|
|||
} else {
|
||||
$user_name = "Unassigned";
|
||||
}
|
||||
return $this->asset_tag . ' - ' . $this->name . ' (' . $user_name . ') ' . $this->model->name;
|
||||
return $this->asset_tag . ' - ' . $this->name . ' (' . $user_name . ') ' . ($this->model) ? $this->model->name: '';
|
||||
}
|
||||
|
||||
public function validationRules($id = '0')
|
||||
|
|
Loading…
Reference in a new issue