diff --git a/post/clang_tidy_review/clang_tidy_review/__init__.py b/post/clang_tidy_review/clang_tidy_review/__init__.py index 60fb2b8..35f8765 100644 --- a/post/clang_tidy_review/clang_tidy_review/__init__.py +++ b/post/clang_tidy_review/clang_tidy_review/__init__.py @@ -286,7 +286,7 @@ def pull_request(self): self._pull_request = self.repo.get_pull(int(self.pr_number)) return self._pull_request - def get_pr_diff(self) -> List[unidiff.PatchSet]: + def get_pr_diff(self) -> List[unidiff.PatchedFile]: """Download the PR diff, return a list of PatchedFile""" _, data = self.repo._requester.requestJsonAndCheck( @@ -294,6 +294,9 @@ def get_pr_diff(self) -> List[unidiff.PatchSet]: self.pull_request.url, headers={"Accept": f"application/vnd.github.{'v3.diff'}"}, ) + if not data: + return [] + diffs = data["data"] # PatchSet is the easiest way to construct what we want, but the