From 731ad033482531b03ba36379f1e3962426098a6d Mon Sep 17 00:00:00 2001 From: sabaimran Date: Sun, 7 Apr 2024 14:52:02 +0530 Subject: [PATCH] Skip indexing commits that are missing properties --- src/khoj/processor/content/github/github_to_entries.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/khoj/processor/content/github/github_to_entries.py b/src/khoj/processor/content/github/github_to_entries.py index c3135b36..a3b4cdbc 100644 --- a/src/khoj/processor/content/github/github_to_entries.py +++ b/src/khoj/processor/content/github/github_to_entries.py @@ -192,7 +192,10 @@ class GithubToEntries(TextToEntries): # Extract commit messages from the response for commit in content: - commits += [{"content": commit["commit"]["message"], "path": commit["html_url"]}] + if "commit" in commit and "message" in commit["commit"] and "html_url" in commit: + commits += [{"content": commit["commit"]["message"], "path": commit["html_url"]}] + else: + logger.debug(f"Skipping commit with missing properties: {commit}") # Get the URL for the next page of commits, if any commits_url = response.links.get("next", {}).get("url")