FIX Protect against undefined index when using nullifyEmpty opt… (#9090)

FIX Protect against undefined index when using nullifyEmpty option
This commit is contained in:
Guy Marriott 2019-06-27 11:19:42 +12:00 committed by GitHub
commit b01dc580e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,7 @@ abstract class DBString extends DBField
*/
public function getNullifyEmpty()
{
return $this->options['nullifyEmpty'];
return !empty($this->options['nullifyEmpty']);
}
/**
@ -99,7 +99,7 @@ abstract class DBString extends DBField
}
// Return "empty" value
if ($this->options['nullifyEmpty'] || $value === null) {
if ($this->getNullifyEmpty() || $value === null) {
return null;
}
return '';