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:
snipe 2017-10-24 16:53:46 -07:00
parent bbda0dc3b4
commit 715da63581

View file

@ -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')