Skip to content

Commit 04e1a76

Browse files
authored
Merge pull request #1127 from Microsoft/b/guard-pr-data
Guard PR data
2 parents f9de4f6 + 3cc0d73 commit 04e1a76

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/github/githubRepository.ts

+10
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,16 @@ export class GitHubRepository implements IGitHubRepository, vscode.Disposable {
221221
});
222222

223223
const hasMorePages = !!result.headers.link && result.headers.link.indexOf('rel="next"') > -1;
224+
if (!result.data) {
225+
// We really don't expect this to happen, but it seems to (see #574).
226+
// Log a warning and return an empty set.
227+
Logger.appendLine(`Warning: no result data for ${remote.owner}/${remote.repositoryName} Status: ${result.status}`);
228+
return {
229+
pullRequests: [],
230+
hasMorePages: false,
231+
};
232+
}
233+
224234
const pullRequests = result.data
225235
.map(
226236
pullRequest => {

0 commit comments

Comments
 (0)