浏览代码

Update Admin toString method

As the getSubject method may return a boolean, the toString method can throw an exception.
Emmanuel Vella 12 年之前
父节点
当前提交
c9f7ef8951
共有 1 个文件被更改,包括 4 次插入0 次删除
  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;
         }