Explorar el Código

Avoid fatal error if the option is null

Thomas Rabaix hace 14 años
padre
commit
e8dfbbbf74
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      Form/Type/AdminType.php

+ 4 - 0
Form/Type/AdminType.php

@@ -54,6 +54,10 @@ class AdminType extends AbstractType
      */
     public function getFieldDescription(array $options)
     {
+        if (!$options['field_description']) {
+            throw new \RuntimeException('Please provide a valid `field_description` option');
+        }
+
         return $options['field_description'];
     }