Browse Source

Avoid fatal error if the option is null

Thomas Rabaix 14 years ago
parent
commit
e8dfbbbf74
1 changed files with 4 additions and 0 deletions
  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'];
     }