Skip to content

Commit d14d83f

Browse files
authored
Merge pull request #16803 from raicabogdan/5.0.x-entity-binding
Fix bug when trying to assign data to null entity
2 parents 0cde937 + 2e72ba9 commit d14d83f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

phalcon/Filter/Validation.zep

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ class Validation extends Injectable implements ValidationInterface
179179
let this->data = data;
180180
this->setEntity(entity);
181181

182-
if unlikely (typeof data != "array" && typeof data != "object") {
182+
// if data is not an array / object or if the entity is null, then no need to proceed further
183+
if unlikely (typeof data != "array" && typeof data != "object") || (null === entity) {
183184
return this;
184185
}
185186

0 commit comments

Comments
 (0)