diff --git a/src/BaseCommand.php b/src/BaseCommand.php index 8eedb8c..a3329e8 100644 --- a/src/BaseCommand.php +++ b/src/BaseCommand.php @@ -84,15 +84,17 @@ protected function reposFromLockfile($lockContent) $output = array(); - foreach ($lock['packages'] as $package) { - switch ($package['source']['type']) { - case 'git': - $output[$package['name']] = $package['source']; - break; - default: - throw new \LogicException("Bad package source type: '" . $package['source']['type'] . "'"); - } - } + foreach ($lock['packages'] as $package) { + if (isset($package['source'])) { + switch ($package['source']['type']) { + case 'git': + $output[$package['name']] = $package['source']; + break; + default: + throw new \LogicException("Bad package source type: '" . $package['source']['type'] . "'"); + } + } + } return $output; }