summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarkus Staab <markus.staab@redaxo.de>2019-05-07 16:29:23 +0200
committerGitHub <noreply@github.com>2019-05-07 16:29:23 +0200
commit323eae343217d5f302906cccd7b957102020ccfc (patch)
tree507e9230fb5b05cf8fce4aaa8cca5f3d6e86e9b6 /src
parent59af8990ed2ede94d4ba1c441954a95086c4c36b (diff)
downloadsql-parser-323eae343217d5f302906cccd7b957102020ccfc.zip
sql-parser-323eae343217d5f302906cccd7b957102020ccfc.tar.gz
sql-parser-323eae343217d5f302906cccd7b957102020ccfc.tar.bz2
Added null check
Diffstat (limited to 'src')
-rw-r--r--src/Statement.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Statement.php b/src/Statement.php
index 439eb13..c7fb944 100644
--- a/src/Statement.php
+++ b/src/Statement.php
@@ -401,9 +401,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;
+ }
}
}
}