diff --git a/src/Command/GithubCommand.php b/src/Command/GithubCommand.php index b4addaa..6af0ab2 100644 --- a/src/Command/GithubCommand.php +++ b/src/Command/GithubCommand.php @@ -55,7 +55,7 @@ private function assembleContextByUrl(string $url): Context { $pregMatch = preg_match('/^https:\/\/github\.com\/(?[\w\-]*)\/(?[\w\-]*)\/pull\/(?\d*)/', $url, $matches); - if ($pregMatch === 0) { + if ($pregMatch === 0 || !isset($matches['owner'], $matches['repo'], $matches['id'])) { throw new \InvalidArgumentException('The given url must be a valid Github URL'); }