Navigation Menu

Skip to content

Commit

Permalink
Don't break on removing a non-existing rule
Browse files Browse the repository at this point in the history
  • Loading branch information
WrDX committed Mar 9, 2018
1 parent fb5c3ec commit 1f0c973
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Model/ModelValidator.php
Expand Up @@ -594,7 +594,7 @@ public function remove($field, $rule = null) {
$this->_parseRules();
if ($rule === null) {
unset($this->_fields[$field]);
} else {
} elseif (array_key_exists($field, $this->_fields)) {
$this->_fields[$field]->removeRule($rule);
}
return $this;
Expand Down

0 comments on commit 1f0c973

Please sign in to comment.