From 1553ba5630aab368a421f30541809cf2f0aa4135 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 3 Jul 2024 20:52:12 +0100 Subject: [PATCH] Added null coalescence for admin id in case via cli Signed-off-by: snipe --- app/Listeners/LogListener.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Listeners/LogListener.php b/app/Listeners/LogListener.php index 57eee03f1..b44fcdfcb 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();