Fix notifications crash

When loading notifications, $this->type was null and thus array_get
was returning an array instead of null. I assume this issue was
introduced in a Laravel version upgrade? Anyway, this fixes it.
This commit is contained in:
Toby Zerner 2018-09-21 11:22:26 +09:30
parent 1114de5338
commit 2d3f1d9f5c

View File

@ -102,7 +102,7 @@ class Notification extends AbstractModel
*/
public function getSubjectModelAttribute()
{
return array_get(static::$subjectModels, $this->type);
return $this->type ? array_get(static::$subjectModels, $this->type) : null;
}
/**