We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 949406a commit b8a87ebCopy full SHA for b8a87eb
1 file changed
src/pages/Contributors/Contributors.tsx
@@ -69,6 +69,13 @@ export default function Contributors() {
69
token
70
);
71
72
+ // Some repos return 204 No Content when there are no contributors.
73
+ // res.ok is true for 204, but res.json() would throw; handle it explicitly.
74
+ if (res.status === 204) {
75
+ setContributors([]);
76
+ return;
77
+ }
78
+
79
if (!res.ok) {
80
const txt = await res.text();
81
throw new Error(`GitHub ${res.status}: ${txt}`);
0 commit comments