Skip to content
Snippets Groups Projects
Commit 1ab9b09d authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(github): catch empty graphql data

parent 15d6d350
No related branches found
No related tags found
No related merge requests found
......@@ -890,6 +890,11 @@ async function getOpenPrs() {
};
const res = JSON.parse((await get.post(url, options)).body);
const prNumbers = [];
// istanbul ignore if
if (!res.data) {
logger.warn({ res }, 'No graphql res.data');
return {};
}
for (const pr of res.data.repository.pullRequests.nodes) {
// https://developer.github.com/v4/object/pullrequest/
pr.displayNumber = `Pull Request #${pr.number}`;
......@@ -986,6 +991,11 @@ async function getClosedPrs() {
};
const res = JSON.parse((await get.post(url, options)).body);
const prNumbers = [];
// istanbul ignore if
if (!res.data) {
logger.warn({ res }, 'No graphql res.data');
return {};
}
for (const pr of res.data.repository.pullRequests.nodes) {
// https://developer.github.com/v4/object/pullrequest/
pr.displayNumber = `Pull Request #${pr.number}`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment