mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-08-15 08:20:33 +02: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;
|
model.branches = this._data.branches;
|
||||||
|
|
||||||
const selected = model.branches.filter((f) => f.name == opt.branch)[0];
|
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
|
// get the list of repo from github
|
||||||
const octokit = new Octokit({ auth: opt.accessToken });
|
const octokit = new Octokit({ auth: opt.accessToken });
|
||||||
const ghRes = await octokit.repos.getReadme({
|
const ghRes = await octokit.repos.getReadme({
|
||||||
|
|||||||
Reference in New Issue
Block a user