From e1551d61f5c9ff53d4e84fda6d623e6bca8bee6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Wernst=C3=A5l?= Date: Wed, 11 Dec 2019 14:25:14 +0100 Subject: [PATCH] fix: avoid crashing if the rule does not contain a job --- src/MagentoHackathon/Composer/Magento/Plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MagentoHackathon/Composer/Magento/Plugin.php b/src/MagentoHackathon/Composer/Magento/Plugin.php index aea3fd2e..13a4d1a8 100644 --- a/src/MagentoHackathon/Composer/Magento/Plugin.php +++ b/src/MagentoHackathon/Composer/Magento/Plugin.php @@ -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 .