mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Don't break on removing a non-existing rule
This commit is contained in:
parent
fb5c3ecd71
commit
1f0c973681
1 changed files with 1 additions and 1 deletions
|
@ -594,7 +594,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
$this->_parseRules();
|
||||
if ($rule === null) {
|
||||
unset($this->_fields[$field]);
|
||||
} else {
|
||||
} elseif (array_key_exists($field, $this->_fields)) {
|
||||
$this->_fields[$field]->removeRule($rule);
|
||||
}
|
||||
return $this;
|
||||
|
|
Loading…
Reference in a new issue