Skip to content

Commit 387c163

Browse files
authored
Merge pull request #168 from PolinaBevad/f_fix_NPE_insertion_adjust_ref
Fixed NPE while adjusting reference
2 parents 989b12c + 6840d27 commit 387c163

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

src/main/java/com/astrazeneca/vardict/modules/ToVarsBuilder.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,11 @@ public static Tuple.Tuple2<Integer, Map<Integer, Vars>> toVars(Region region,
235235
if (cov.containsKey(p + 1) && ttcov < cov.get(p + 1) - cnt.cnt) {
236236
ttcov = cov.get(p + 1);
237237
// Adjust the reference
238-
getVariationMaybe(hash, p + 1, ref.get(p + 1)).dirPlus -= fwd;
239-
getVariationMaybe(hash, p + 1, ref.get(p + 1)).dirMinus -= rev;
238+
Variation variantNextPosition = getVariationMaybe(hash, p + 1, ref.get(p + 1));
239+
if (variantNextPosition != null) {
240+
variantNextPosition.dirPlus -= fwd;
241+
variantNextPosition.dirMinus -= rev;
242+
}
240243
}
241244
tcov = ttcov;
242245
}
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)