Skip to content

Commit 40b73e4

Browse files
authored
fix(command-bus): prevent crash when accessing deleted pending commands (#1926)
1 parent 4863e30 commit 40b73e4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/command-bus/src/AsyncCommandRepositories/FileCommandRepository.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ public function getPendingCommands(): array
5353
{
5454
return arr(glob(__DIR__ . '/../stored-commands/*.pending.txt'))
5555
->mapWithKeys(function (string $path) {
56+
if (! Filesystem\is_file($path)) {
57+
return;
58+
}
59+
5660
$uuid = str_replace('.pending.txt', '', pathinfo($path, PATHINFO_BASENAME));
5761
$payload = Filesystem\read_file($path);
5862

0 commit comments

Comments
 (0)