1
0
mirror of https://github.com/flarum/core.git synced 2025-02-24 03:05:12 +01:00

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 c32af6559e
commit 986d811a16

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;
}
/**