diff --git a/app/Notifications/CheckinLicenseNotification.php b/app/Notifications/CheckinLicenseNotification.php index f8a52ccf3c57..a0327f6fafed 100644 --- a/app/Notifications/CheckinLicenseNotification.php +++ b/app/Notifications/CheckinLicenseNotification.php @@ -76,10 +76,18 @@ public function toSlack($notifiable) $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ; - $fields = [ - 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', - 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', - ]; + if ($admin) { + $fields = [ + 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', + 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', + ]; + } else { + $fields = [ + 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', + 'By' => 'CLI tool', + ]; + } +