When we dont have session() details return a blank string instead of null

This commit is contained in:
Deon George 2023-10-03 09:11:08 +11:00
parent 782acad560
commit 2a50a1d795

View File

@ -859,6 +859,6 @@ class Address extends Model
*/
public function session(string $type): ?string
{
return ($this->exists && ($x=$this->system->sessions->where('id',$this->zone_id)->first())) ? $x->pivot->{$type} : NULL;
return ($this->exists && ($x=$this->system->sessions->where('id',$this->zone_id)->first())) ? ($x->pivot->{$type} ?: '') : NULL;
}
}