Skip to content

Commit

Permalink
Ensure protect command works when composer package type in repo list
Browse files Browse the repository at this point in the history
  • Loading branch information
NickDickinsonWilde authored Nov 6, 2024
1 parent 05a6d3e commit dada65e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ProtectCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down

0 comments on commit dada65e

Please sign in to comment.