Skip to content

Commit

Permalink
Merge pull request #288 from pajkho/patch-1
Browse files Browse the repository at this point in the history
 Fix Call to a member function only() on null error
  • Loading branch information
musonza authored Aug 22, 2021
2 parents 13dd521 + 2c05bdd commit 0adba89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Models/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public function getSenderAttribute()
{
$participantModel = $this->participation->messageable;

if (!isset($participantModel)) {
return null;
}

if (method_exists($participantModel, 'getParticipantDetails')) {
return $participantModel->getParticipantDetails();
}
Expand Down

0 comments on commit 0adba89

Please sign in to comment.