Skip to content

Commit 5ca0405

Browse files
committed
fix(v4): rate limit is null when GHE has no rate limit settings
1 parent 6116c67 commit 5ca0405

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/Renderer/Library/GitHub/V4/GitHubV4Client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export class GitHubV4Client {
6161
}
6262

6363
private async waitRateLimit(data: RemoteGitHubV4Entity) {
64+
// GHEの場合、rateLimitが設定されていない場合がある
65+
if (!data.rateLimit) return;
6466
if (data.rateLimit.remaining > 0) return;
6567

6668
const resetAtMillSec = new Date(data.rateLimit.resetAt).getTime();

src/Renderer/Library/Type/RemoteGitHubV4/RemoteGitHubV4Entity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export type RemoteGitHubV4Entity = {
44
limit: number;
55
remaining: number;
66
resetAt: string; // YYYY-MM-DDThh:mm:ssZ
7-
}
7+
} | null
88
}

0 commit comments

Comments
 (0)