소스 검색

Fixed undefined index notice in readProperty() method (PropertyPath)

William DURAND 13 년 전
부모
커밋
57e1aebb27
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/Symfony/Component/Form/Util/PropertyPath.php

+ 3 - 1
src/Symfony/Component/Form/Util/PropertyPath.php

@@ -279,7 +279,9 @@ class PropertyPath implements \IteratorAggregate
                 throw new InvalidPropertyException(sprintf('Index "%s" cannot be read from object of type "%s" because it doesn\'t implement \ArrayAccess', $property, get_class($object)));
             }
 
-            return $object[$property];
+            if (isset($object[$property])) {
+                return $object[$property];
+            }
         } else {
             $camelProp = $this->camelize($property);
             $reflClass = new \ReflectionClass($object);