Skip to content

Commit

Permalink
fix null pointer exception caused by
Browse files Browse the repository at this point in the history
getDeletedLineWithHighestSimilarityInDiff returning null
  • Loading branch information
SkyBlaise99 committed Sep 5, 2023
1 parent f8a8f30 commit 489cf6d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ private static CandidateLine getDeletedLineWithHighestSimilarity(RepoConfigurati

CandidateLine candidateLine = getDeletedLineWithHighestSimilarityInDiff(
fileDiffResult, lineContent, parentCommit, preImageFilePath);
if (candidateLine == null) {
continue;

Check warning on line 118 in src/main/java/reposense/authorship/analyzer/AuthorshipAnalyzer.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/reposense/authorship/analyzer/AuthorshipAnalyzer.java#L118

Added line #L118 was not covered by tests
}

if (highestSimilarityLine == null
|| candidateLine.getSimilarityScore() > highestSimilarityLine.getSimilarityScore()) {
highestSimilarityLine = candidateLine;
Expand Down

0 comments on commit 489cf6d

Please sign in to comment.