Skip to content

Commit ff04234

Browse files
committed
Fixing PHPStan error
1 parent f889377 commit ff04234

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/special_cases.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function preg_replace($pattern, $replacement, $subject, int $limit = -1, int &$c
154154
{
155155
error_clear_last();
156156
$result = \preg_replace($pattern, $replacement, $subject, $limit, $count);
157-
if (preg_last_error() !== PREG_NO_ERROR) {
157+
if (preg_last_error() !== PREG_NO_ERROR || $result === null) {
158158
throw PcreException::createFromPhpError();
159159
}
160160
return $result;

0 commit comments

Comments
 (0)