Skip to content

Commit ca3744b

Browse files
committed
Guard against null token after trailing backslash in text role
Fixes phpDocumentor/phpDocumentor#4082
1 parent 06c64f5 commit ca3744b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • packages/guides-restructured-text/src/RestructuredText/Parser/Productions/InlineRules

packages/guides-restructured-text/src/RestructuredText/Parser/Productions/InlineRules/TextRoleRule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public function apply(BlockContext $blockContext, InlineLexer $lexer): InlineNod
7878
case InlineLexer::BACKSLASH:
7979
$rawPart .= $token->value;
8080
$lexer->moveNext();
81+
if ($lexer->token === null) {
82+
break 2;
83+
}
84+
8185
$part .= $lexer->token->value;
8286
$rawPart .= $lexer->token->value;
8387

0 commit comments

Comments
 (0)