aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-duplications
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-duplications')
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java
index be93463a5e4..46e57fa9209 100644
--- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java
+++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/OriginalCloneDetectionAlgorithm.java
@@ -156,7 +156,7 @@ public final class OriginalCloneDetectionAlgorithm {
// fixed order) is equal to f(j) and only report in this case.
Block first = currentBlocksGroup.first(originResourceId);
- if (first.getIndexInFile() == j - 2) {
+ if (first != null && first.getIndexInFile() == j - 2) {
// Godin: We report clones, which start in i-1 and end in j-2, so length is j-2-(i-1)+1=j-i
reportClones(sameHashBlocksGroups[i], currentBlocksGroup, j - i);
}