Skip to content

Commit

Permalink
Fix packagist:get-updates error on first run
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioheleno committed Oct 31, 2023
1 parent 17b6303 commit 8c74047
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Application/Console/Packagist/GetUpdatesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
1
);

$preference = $preferenceCol->first();
if ($preference === null) {
if ($preferenceCol->isEmpty()) {
$io->text(
sprintf(
'[%s] Last update not set',
Expand All @@ -92,6 +91,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
(string)$updates['timestamp'],
PreferenceTypeEnum::isInteger
);
} else {
$preference = $preferenceCol->first();
}

$io->text(
Expand Down

0 comments on commit 8c74047

Please sign in to comment.