Skip to content

A free open source IT asset/license management system

Fixed slack notification error if location is not set on checkin

snipe188538651ac1
diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php
index a22ccae7cf..72a950fdcd 100644
--- a/app/Notifications/CheckinAssetNotification.php
+++ b/app/Notifications/CheckinAssetNotification.php
@@ -76,7 +76,7 @@ class CheckinAssetNotification extends Notification
$fields = [
trans('general.administrator') => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
trans('general.status') => $item->assetstatus->name,
- trans('general.location') => $item->location->name,
+ trans('general.location') => ($item->location) ? $item->location->name : '',
];
return (new SlackMessage)