diff --git a/src/ProtectCommand.php b/src/ProtectCommand.php index 1dfcb00..88f922c 100644 --- a/src/ProtectCommand.php +++ b/src/ProtectCommand.php @@ -39,7 +39,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $key = $input->getArgument('repository'); foreach ($repositories as $index => $repository) { - if ($index === $key || $repository['url'] === $key) { + if ($index === $key || (isset($repository['url']) && $repository['url'] === $key)) { if ($repository['type'] !== 'composer') { throw new \RuntimeException("Only Composer repositories can be protected by TUF."); }