From 4b7df63403505768dbb58c6bd2003321c366a9f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.chilliet@fusiondirectory.org>
Date: Tue, 7 Jul 2020 15:24:43 +0200
Subject: [PATCH] :ambulance: fix(errors) Try to avoid errors in errors

issue #6071
---
 include/errors/class_SimplePluginError.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/errors/class_SimplePluginError.inc b/include/errors/class_SimplePluginError.inc
index 6fbccc78c..397077e3f 100644
--- a/include/errors/class_SimplePluginError.inc
+++ b/include/errors/class_SimplePluginError.inc
@@ -52,6 +52,9 @@ class SimplePluginError extends FusionDirectoryError
         trigger_error('Invalid origin of class '.get_class($origin));
       }
     }
+    if (!$this->object instanceof simpleTabs) {
+      $this->object = NULL;
+    }
   }
 
   public function toArray (): array
@@ -81,7 +84,7 @@ class SimplePluginError extends FusionDirectoryError
       $html .= htmlescape($this->object->getBaseObject()->dn.' > ');
     }
 
-    if (isset($this->tab)) {
+    if (isset($this->tab) && isset($this->tab->parent->by_name[get_class($this->tab)])) {
       $html .= htmlescape($this->tab->parent->by_name[get_class($this->tab)].' > ');
     }
 
-- 
GitLab