Skip to content

Commit 0fba343

Browse files
committed
Add guard on github response destructuring
1 parent d0752b2 commit 0fba343

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/github-enricher/gatsby-node.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@ const fetchScmInfo = async (scmUrl, artifactId, labels) => {
239239
}
240240
}
241241

242-
if (body?.data) {
242+
if (!body?.data && !body?.data?.repository) {
243+
console.warn("Strange artifact for ", artifactId, "- response is", body)
244+
}
245+
246+
if (body?.data && body?.data?.repository) {
243247
const {
244248
data: {
245249
repository: {

0 commit comments

Comments
 (0)