summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsaac Bennetch <bennetch@gmail.com>2019-05-08 20:19:08 -0400
committerGitHub <noreply@github.com>2019-05-08 20:19:08 -0400
commitb032d820233cce11b5488981e29db53738fb9c0c (patch)
treea450df7b8226b386e2ab698be5b9aeb4182ff6bb
parentce4e30eae3f25af632ae88c58e493fbee188cda4 (diff)
parent323eae343217d5f302906cccd7b957102020ccfc (diff)
downloadsql-parser-b032d820233cce11b5488981e29db53738fb9c0c.zip
sql-parser-b032d820233cce11b5488981e29db53738fb9c0c.tar.gz
sql-parser-b032d820233cce11b5488981e29db53738fb9c0c.tar.bz2
Merge pull request #245 from staabm/patch-1
Added null check to fix tests from pull request #224.
-rw-r--r--src/Statement.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Statement.php b/src/Statement.php
index e7238f2..de94951 100644
--- a/src/Statement.php
+++ b/src/Statement.php
@@ -403,9 +403,11 @@ abstract class Statement
$this->after($parser, $list, $token);
// #223 Here may make a patch, if last is delimiter, back one
- if ((new $class()) instanceof FunctionCall) {
- if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
- --$list->idx;
+ if ($class !== null) {
+ if ((new $class()) instanceof FunctionCall) {
+ if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
+ --$list->idx;
+ }
}
}
}