Pārlūkot izejas kodu

Update Admin toString method

As the getSubject method may return a boolean, the toString method can throw an exception.
Emmanuel Vella 12 gadi atpakaļ
vecāks
revīzija
c9f7ef8951
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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;
         }