Skip to content

A free open source IT asset/license management system

Handle settings not being available

Marcus Moored57f56e44f99
diff --git a/app/Models/User.php b/app/Models/User.php
index a115852d5c..9b211e6a04 100644
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -320,7 +320,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
{
$setting = Setting::getSettings();
- if ($setting->name_display_format=='last_first') {
+ if ($setting?->name_display_format == 'last_first') {
return ($this->last_name) ? $this->last_name.' '.$this->first_name : $this->first_name;
}
return $this->last_name ? $this->first_name.' '.$this->last_name : $this->first_name;