Skip to content

Commit e1551d6

Browse files
committed
fix: avoid crashing if the rule does not contain a job
1 parent 3f78853 commit e1551d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MagentoHackathon/Composer/Magento/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public function onPackageUpdate(PackageEvent $event)
264264
$rule = $event->getOperation()->getReason();
265265
if ($rule instanceof Rule) {
266266
if ($event->getOperation()->getJobType() === 'update') {
267-
if ($rule->getJob()['packageName'] === 'magento-hackathon/magento-composer-installer') {
267+
if ($rule->getJob() && $rule->getJob()['packageName'] === 'magento-hackathon/magento-composer-installer') {
268268
throw new \Exception(
269269
'Dont update the "magento-hackathon/magento-composer-installer" with active plugins.' . PHP_EOL .
270270
'Consult the documentation on how to update the Installer' . PHP_EOL .

0 commit comments

Comments
 (0)