Skip to content

Commit

Permalink
Fix "Trying to access array offset on value of type null" (#228)
Browse files Browse the repository at this point in the history
Added a check that `$previous` is not null (i.e. previous token exists)
  • Loading branch information
dryabov authored Feb 12, 2020
1 parent e834eea commit 5065faf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion EmailValidator/Parser/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ protected function escaped()
{
$previous = $this->lexer->getPrevious();

if ($previous['type'] === EmailLexer::S_BACKSLASH
if ($previous && $previous['type'] === EmailLexer::S_BACKSLASH
&&
$this->lexer->token['type'] !== EmailLexer::GENERIC
) {
Expand Down

0 comments on commit 5065faf

Please sign in to comment.