Catch random exception because why not.

This commit is contained in:
James Cole
2025-09-10 07:03:23 +02:00
parent 6ea7152423
commit 27480561ee

View File

@@ -27,6 +27,7 @@ namespace FireflyIII\Console\Commands\System;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Support\System\GeneratesInstallationId; use FireflyIII\Support\System\GeneratesInstallationId;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Random\RandomException;
class OutputsInstructions extends Command class OutputsInstructions extends Command
{ {
@@ -266,7 +267,11 @@ class OutputsInstructions extends Command
]; ];
} }
$random = random_int(0, count($lines) - 1); try {
$random = random_int(0, count($lines) - 1);
} catch (RandomException $e) {
$random = 0;
}
if ($addQuotes) { if ($addQuotes) {
$this->line(sprintf(' "%s"', $lines[$random])); $this->line(sprintf(' "%s"', $lines[$random]));