mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Catch random exception because why not.
This commit is contained in:
@@ -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
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
$random = random_int(0, count($lines) - 1);
|
$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]));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user