Skip to content

A free open source IT asset/license management system

Adds a null coalescing operator to the license seat checkin notification

Ivan Nieto Vivanco3cf9c1fea536
diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php
index 09cb3ae8f2..fc86245d1a 100644
--- a/app/Listeners/CheckoutableListener.php
+++ b/app/Listeners/CheckoutableListener.php
@@ -79,8 +79,8 @@ class CheckoutableListener
/**
* Send the appropriate notification
*/
- $acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id)
- ->where('assigned_to_id', $event->checkedOutTo->id)
+ $acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id ?? null)
+ ->where('assigned_to_id', $event->checkedOutTo->id ?? null)
->get();
foreach($acceptances as $acceptance){