Skip to content

Commit 323eae3

Browse files
authored
Added null check
1 parent 59af899 commit 323eae3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Statement.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,11 @@ public function parse(Parser $parser, TokensList $list)
401401
$this->after($parser, $list, $token);
402402

403403
// #223 Here may make a patch, if last is delimiter, back one
404-
if ((new $class()) instanceof FunctionCall) {
405-
if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
406-
--$list->idx;
404+
if ($class !== null) {
405+
if ((new $class()) instanceof FunctionCall) {
406+
if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
407+
--$list->idx;
408+
}
407409
}
408410
}
409411
}

0 commit comments

Comments
 (0)