diff --git a/src/main/java/org/refactoringminer/api/PurityChecker.java b/src/main/java/org/refactoringminer/api/PurityChecker.java index c0e2f09675..4f6410c03f 100644 --- a/src/main/java/org/refactoringminer/api/PurityChecker.java +++ b/src/main/java/org/refactoringminer/api/PurityChecker.java @@ -1914,19 +1914,20 @@ private static void checkForStatementsBeingMappedInTargetOperation(InlineOperati UMLClassBaseDiff umlClassDiff = modelDiff.getUMLClassDiff(refactoring.getTargetOperationAfterInline().getClassName()); List nonMappedLeavesT1ToRemove = new ArrayList<>(); - - for (UMLOperationBodyMapper umlOperationBodyMapper : umlClassDiff.getOperationBodyMapperList()) { - if (umlOperationBodyMapper != null && umlOperationBodyMapper.getOperation2() != null) { - if (umlOperationBodyMapper.getOperation2().getName().equals(refactoring.getTargetOperationAfterInline().getName())) { - for (AbstractCodeFragment abstractCodeFragment : nonMappedLeavesT1) { - for (AbstractCodeMapping mapping : umlOperationBodyMapper.getMappings()) { - if (mapping.getFragment2().getString().equals(abstractCodeFragment.getString())) { - nonMappedLeavesT1ToRemove.add(abstractCodeFragment); - } - } - } - } - } + if (umlClassDiff != null) { + for (UMLOperationBodyMapper umlOperationBodyMapper : umlClassDiff.getOperationBodyMapperList()) { + if (umlOperationBodyMapper != null && umlOperationBodyMapper.getOperation2() != null) { + if (umlOperationBodyMapper.getOperation2().getName().equals(refactoring.getTargetOperationAfterInline().getName())) { + for (AbstractCodeFragment abstractCodeFragment : nonMappedLeavesT1) { + for (AbstractCodeMapping mapping : umlOperationBodyMapper.getMappings()) { + if (mapping.getFragment2().getString().equals(abstractCodeFragment.getString())) { + nonMappedLeavesT1ToRemove.add(abstractCodeFragment); + } + } + } + } + } + } } nonMappedLeavesT1.removeAll(nonMappedLeavesT1ToRemove); }