DirectorDataFieldForm: make sure object exists...

...even when an exception occurs
This commit is contained in:
Thomas Gelf 2017-07-11 15:38:37 +02:00
parent 180fc2ccfa
commit 373d01ad64

View File

@ -181,8 +181,8 @@ class DirectorDatafieldForm extends DirectorObjectForm
$this->getElement('datatype')->addError($error);
}
$object = $this->object();
try {
$object = $this->object();
if ($class = $this->getSentValue('datatype')) {
if ($class && array_key_exists($class, $types)) {
$this->addSettings($class);