Skip to content

Commit 8ce4da2

Browse files
authored
Do not call strlen() on null (#657)
1 parent cd26b16 commit 8ce4da2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/JsonSchema/Constraints/Constraint.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface
4343
protected function incrementPath(JsonPointer $path = null, $i)
4444
{
4545
$path = $path ?: new JsonPointer('');
46+
47+
if ($i === null || $i === '') {
48+
return $path;
49+
}
50+
4651
$path = $path->withPropertyPaths(
4752
array_merge(
4853
$path->getPropertyPaths(),
49-
array_filter(array($i), 'strlen')
54+
array($i)
5055
)
5156
);
5257

0 commit comments

Comments
 (0)