return if there is no item for the audit notification

This commit is contained in:
Godfrey M
2025-11-20 10:56:43 -08:00
parent 9d08e2d297
commit eceeb4aa3b

View File

@@ -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)