Handle settings not being available

This commit is contained in:
Marcus Moore
2025-05-08 16:20:26 -07:00
parent 40c65a07a4
commit d57f56e44f
+1 -1
View File
@@ -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;