FIX Protect against undefined index when using nullifyEmpty option

This commit is contained in:
Robbie Averill 2019-06-26 09:26:36 +12:00
parent 054dbd6ae5
commit c76d3a5db1

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 '';