mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
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:
commit
c7b24821b3
|
@ -79,13 +79,15 @@ class CheckoutableListener
|
||||||
/**
|
/**
|
||||||
* Send the appropriate notification
|
* Send the appropriate notification
|
||||||
*/
|
*/
|
||||||
$acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id)
|
if ($event->checkedOutTo && $event->checkoutable){
|
||||||
->where('assigned_to_id', $event->checkedOutTo->id)
|
$acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id)
|
||||||
->get();
|
->where('assigned_to_id', $event->checkedOutTo->id)
|
||||||
|
->get();
|
||||||
|
|
||||||
foreach($acceptances as $acceptance){
|
foreach($acceptances as $acceptance){
|
||||||
if($acceptance->isPending()){
|
if($acceptance->isPending()){
|
||||||
$acceptance->delete();
|
$acceptance->delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue