diff --git a/app/Models/Asset.php b/app/Models/Asset.php index c88c27956f..3531b55043 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -376,7 +376,10 @@ class Asset extends Depreciable { if ($this->name == '') { - return $this->model->name.' ('.$this->asset_tag.')'; + if ($this->model) { + return $this->model->name.' ('.$this->asset_tag.')'; + } + return $this->asset_tag; } else { return $this->name; } diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index bc188450a9..88fe0bfa8d 100755 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -120,7 +120,11 @@ {{ date("M d, Y g:iA", strtotime($activity->created_at)) }} @if ($activity->action_type!='requested') - {{ $activity->adminlog->fullName() }} + @if ($activity->adminlog) + {{ $activity->adminlog->fullName() }} + @else + Deleted Admin + @endif @endif