Skip to content

Commit 6ad0bb6

Browse files
committed
Ref #168 - Add type checks in case a null value occurs
Pull-request: #344 Signed-off-by: William Desportes <[email protected]>
1 parent a724b5d commit 6ad0bb6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Components/AlterOperation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@ public static function parse(Parser $parser, TokensList $list, array $options =
293293
$list->getNext();
294294
$nextToken = $list->getNext();
295295

296-
if ($token->value === 'CHARACTER SET'){
296+
if ($token->value === 'CHARACTER SET') {
297297
// Reverting the changes we made in the beginning
298298
$list->idx = $currentTokenID;
299-
} else if ($token->value === 'SET' && $nextToken->value === '('){
299+
} else if ($token->value === 'SET' && $nextToken !== null && $nextToken->value === '(') {
300300
// To avoid adding the tokens between the SET() parentheses to the unknown tokens
301301
$list->getNextOfTypeAndValue(Token::TYPE_OPERATOR, ')');
302-
} else if ($token->value === 'SET' && $nextToken->value === 'DEFAULT'){
302+
} else if ($token->value === 'SET' && $nextToken !== null && $nextToken->value === 'DEFAULT') {
303303
// to avoid adding the `DEFAULT` token to the unknown tokens.
304304
++$list->idx;
305305
} else {

0 commit comments

Comments
 (0)