Skip to content
Snippets Groups Projects
Commit bf646a56 authored by Ahmad, Rawel's avatar Ahmad, Rawel
Browse files

added check if commit should be none to prevent errors

parent d658a2b1
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,10 @@ class CommitFeatures:
return commit
def save_features_to_json(self, path):
if self.commit is None:
print(f"Could not extract features, commit with SHA={self.commit_sha} not found")
return
if not os.path.exists(path):
os.makedirs(path)
......@@ -82,6 +86,11 @@ class CommitFeatures:
def extract_features(self):
"""Extracts features from a commit"""
if self.commit is None:
print(f"Could not extract features, commit with SHA={self.commit_sha} not found")
return
# load repo
self.features_raw["repo"] = self.repo_path.split("/")[-1]
self.features_raw["hash"] = str(self.commit_sha)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment