Skip to content

Commit

Permalink
Merge pull request #184 from crossroads-loyalty-solutions/fix/on-upda…
Browse files Browse the repository at this point in the history
…te-crash-7

fix: avoid crashing on update if the rule does not contain a job
  • Loading branch information
Flyingmana authored Dec 11, 2019
2 parents 3f78853 + e1551d6 commit b84c5c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MagentoHackathon/Composer/Magento/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function onPackageUpdate(PackageEvent $event)
$rule = $event->getOperation()->getReason();
if ($rule instanceof Rule) {
if ($event->getOperation()->getJobType() === 'update') {
if ($rule->getJob()['packageName'] === 'magento-hackathon/magento-composer-installer') {
if ($rule->getJob() && $rule->getJob()['packageName'] === 'magento-hackathon/magento-composer-installer') {
throw new \Exception(
'Dont update the "magento-hackathon/magento-composer-installer" with active plugins.' . PHP_EOL .
'Consult the documentation on how to update the Installer' . PHP_EOL .
Expand Down

0 comments on commit b84c5c5

Please sign in to comment.