mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-12 18:32:44 +00:00
fix: handle when tthe default branch is not found
This commit is contained in:
@@ -100,7 +100,7 @@ export class GitHubRepository {
|
||||
model.branches = this._data.branches;
|
||||
|
||||
const selected = model.branches.filter((f) => f.name == opt.branch)[0];
|
||||
if (!selected?.readme || opt?.force === true) {
|
||||
if (selected && (!selected.readme || opt?.force === true)) {
|
||||
// get the list of repo from github
|
||||
const octokit = new Octokit({ auth: opt.accessToken });
|
||||
const ghRes = await octokit.repos.getReadme({
|
||||
|
||||
Reference in New Issue
Block a user