diff --git a/app/Libraries/HistoryUtils.php b/app/Libraries/HistoryUtils.php index a9e6c68e9602..e4d907891ce0 100644 --- a/app/Libraries/HistoryUtils.php +++ b/app/Libraries/HistoryUtils.php @@ -106,6 +106,10 @@ class HistoryUtils public static function trackViewed(EntityModel $entity) { + if (! $entity) { + return; + } + $entityType = $entity->getEntityType(); $trackedTypes = [ ENTITY_CLIENT,