Skip to content

A free open source IT asset/license management system

Small tweaks for bad data

snipe139325d8bacf
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 @@
<td>{{ date("M d, Y g:iA", strtotime($activity->created_at)) }}</td>
<td>
@if ($activity->action_type!='requested')
- <a href="{{ route('view/user', $activity->user_id) }}">{{ $activity->adminlog->fullName() }}</a>
+ @if ($activity->adminlog)
+ <a href="{{ route('view/user', $activity->user_id) }}">{{ $activity->adminlog->fullName() }}</a>
+ @else
+ Deleted Admin
+ @endif
@endif
</td>