Procházet zdrojové kódy

Update Admin toString method

As the getSubject method may return a boolean, the toString method can throw an exception.
Emmanuel Vella před 12 roky
rodič
revize
c9f7ef8951
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      Admin/Admin.php

+ 4 - 0
Admin/Admin.php

@@ -2530,6 +2530,10 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
      */
     public function toString($object)
     {
+        if (!is_object($object)) {
+            return '';
+        }
+
         if (method_exists($object, '__toString')) {
             return (string) $object;
         }