Merge pull request #13549 from inietov/fixes/attempt_to_read_property_id_on_null

Fixed ErrorException: Attempt to read property "id" on null (rollbar #3541)
This commit is contained in:
snipe 2023-09-14 12:50:54 +01:00 committed by GitHub
commit c7b24821b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,6 +79,7 @@ class CheckoutableListener
/** /**
* Send the appropriate notification * Send the appropriate notification
*/ */
if ($event->checkedOutTo && $event->checkoutable){
$acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id) $acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id)
->where('assigned_to_id', $event->checkedOutTo->id) ->where('assigned_to_id', $event->checkedOutTo->id)
->get(); ->get();
@ -88,6 +89,7 @@ class CheckoutableListener
$acceptance->delete(); $acceptance->delete();
} }
} }
}
try { try {
if ($this->shouldSendWebhookNotification()) { if ($this->shouldSendWebhookNotification()) {