diff --git a/src/main/java/reposense/authorship/analyzer/AuthorshipAnalyzer.java b/src/main/java/reposense/authorship/analyzer/AuthorshipAnalyzer.java index 0df2731268..5284ef95ba 100644 --- a/src/main/java/reposense/authorship/analyzer/AuthorshipAnalyzer.java +++ b/src/main/java/reposense/authorship/analyzer/AuthorshipAnalyzer.java @@ -114,6 +114,10 @@ private static CandidateLine getDeletedLineWithHighestSimilarity(RepoConfigurati CandidateLine candidateLine = getDeletedLineWithHighestSimilarityInDiff( fileDiffResult, lineContent, parentCommit, preImageFilePath); + if (candidateLine == null) { + continue; + } + if (highestSimilarityLine == null || candidateLine.getSimilarityScore() > highestSimilarityLine.getSimilarityScore()) { highestSimilarityLine = candidateLine;