Skip to content

Commit

Permalink
Only look up addon edition if it's installed. Closes #2782
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Nov 1, 2020
1 parent 2840c51 commit 9f649f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Marketplace/AddonsQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public function get()

$response['data'] = collect($response['data'])->map(function ($addon) use ($installed) {
return $addon + [
'installed' => $installed->contains($addon['id']),
'edition' => Addon::get($addon['package'])->edition(),
'installed' => $isInstalled = $installed->contains($addon['id']),
'edition' => $isInstalled ? Addon::get($addon['package'])->edition() : null,
];
})->all();

Expand Down

0 comments on commit 9f649f2

Please sign in to comment.