Skip to content

Commit 0adba89

Browse files
authored
Merge pull request #288 from pajkho/patch-1
Fix Call to a member function only() on null error
2 parents 13dd521 + 2c05bdd commit 0adba89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Models/Message.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ public function getSenderAttribute()
4848
{
4949
$participantModel = $this->participation->messageable;
5050

51+
if (!isset($participantModel)) {
52+
return null;
53+
}
54+
5155
if (method_exists($participantModel, 'getParticipantDetails')) {
5256
return $participantModel->getParticipantDetails();
5357
}

0 commit comments

Comments
 (0)