Fix "Trying to access array offset on value of type null" (#228)

Added a check that `$previous` is not null (i.e. previous token exists)
This commit is contained in:
Denis Ryabov
2020-02-13 01:28:28 +03:00
committed by GitHub
parent e834eea530
commit 5065fafc8c
+1 -1
View File
@@ -170,7 +170,7 @@ abstract class Parser
{
$previous = $this->lexer->getPrevious();
if ($previous['type'] === EmailLexer::S_BACKSLASH
if ($previous && $previous['type'] === EmailLexer::S_BACKSLASH
&&
$this->lexer->token['type'] !== EmailLexer::GENERIC
) {