From 15777c4a704d73853202ec1d64a15d27558e379d Mon Sep 17 00:00:00 2001 From: tdurieux Date: Wed, 19 Oct 2022 16:13:56 +0200 Subject: [PATCH] fix: verify that a branch is found --- src/source/GitHubRepository.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/source/GitHubRepository.ts b/src/source/GitHubRepository.ts index 8085fc4..5f091fb 100644 --- a/src/source/GitHubRepository.ts +++ b/src/source/GitHubRepository.ts @@ -125,6 +125,13 @@ export class GitHubRepository { } } + if (!selected) { + throw new AnonymousError("readme_not_available", { + httpStatus: 404, + object: this, + }); + } + return selected.readme; }