Skip to content

Commit

Permalink
Fail early if no data could be parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Apr 8, 2019
1 parent 7ed7f46 commit 4244e53
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/CosyComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ public function run()
]);
$app->run($i, $this->output);
$raw_data = $this->output->fetch();
$data = null;
foreach ($raw_data as $delta => $item) {
if (empty($item) || empty($item[0])) {
continue;
Expand All @@ -571,6 +572,11 @@ public function run()
break;
}
}
if (!is_array($data)) {
$this->log('No updates found');
$this->cleanUp();
return;
}
// Remove blacklisted packages.
if (!empty($cdata->extra) && !empty($cdata->extra->violinist) && !empty($cdata->extra->violinist->blacklist)) {
if (!is_array($cdata->extra->violinist->blacklist)) {
Expand Down

0 comments on commit 4244e53

Please sign in to comment.