Skip to content

A free open source IT asset/license management system

return if there is no item for the audit notification

Godfrey Meceeb4aa3b9a
diff --git a/app/Notifications/AuditNotification.php b/app/Notifications/AuditNotification.php
index abcd69c9b6..a01aca7114 100644
--- a/app/Notifications/AuditNotification.php
+++ b/app/Notifications/AuditNotification.php
@@ -84,6 +84,11 @@ class AuditNotification extends Notification
$location = $params['location'] ?? '';
$setting = Setting::getSettings();
+ //if somehow a notification triggers without an item, bail out.
+ if(!$item || !is_object($item)){
+ return null;
+ }
+
if(!Str::contains($setting->webhook_endpoint, 'workflows')) {
return MicrosoftTeamsMessage::create()
->to($setting->webhook_endpoint)