Skip to content

A free open source IT asset/license management system

Added null coalescence for admin id in case via cli

snipe1553ba5630aa
diff --git a/app/Listeners/LogListener.php b/app/Listeners/LogListener.php
index 57eee03f17..b44fcdfcb4 100644
--- a/app/Listeners/LogListener.php
+++ b/app/Listeners/LogListener.php
@@ -111,7 +111,7 @@ class LogListener
$logaction->target_type = User::class;
$logaction->action_type = 'merged';
$logaction->note = trans('general.merged_log_this_user_from', $to_from_array);
- $logaction->user_id = $event->admin->id;
+ $logaction->user_id = $event->admin->id ?? null;
$logaction->save();
// Add a record to the users being merged TO
@@ -122,7 +122,7 @@ class LogListener
$logaction->item_type = User::class;
$logaction->action_type = 'merged';
$logaction->note = trans('general.merged_log_this_user_into', $to_from_array);
- $logaction->user_id = $event->admin->id;
+ $logaction->user_id = $event->admin->id ?? null;
$logaction->save();