Skip to content

Commit

Permalink
Don't crash on empty jit_buffer_size
Browse files Browse the repository at this point in the history
Fixes #9396
  • Loading branch information
weirdan committed Feb 25, 2023
1 parent ae4ec68 commit 38d1abc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Psalm/Internal/Fork/PsalmRestarter.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ protected function requiresRestart($default): bool

private static function toBytes(string $value): int
{
if (strlen($value) === 0) {
return 0;
}

$unit = strtolower($value[strlen($value) - 1]);

if (in_array($unit, ['g', 'm', 'k'], true)) {
Expand Down

0 comments on commit 38d1abc

Please sign in to comment.