Skip to content

Commit 32896dc

Browse files
committed
Update ParserState.php
1 parent 4c378c7 commit 32896dc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Parsing/ParserState.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ public function parseCharacter(bool $isForIdentifier): ?string
176176
$codePoint = $codePoint >> 8;
177177
}
178178
/** @phpstan-ignore theCodingMachineSafe.function */
179-
return \iconv('utf-32le', $this->charset, $utf32EncodedCharacter);
179+
$character = \iconv('utf-32le', $this->charset, $utf32EncodedCharacter);
180+
if ($character === false) {
181+
throw new \RuntimeException('Unexpected error');
182+
}
183+
return $character;
180184
}
181185
if ($isForIdentifier) {
182186
$peek = \ord($this->peek());

0 commit comments

Comments
 (0)