Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java
index f6097dbf4a9..f692980178c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java
@@ -232,8 +232,10 @@ public class ChangeGenerator extends CPPASTVisitor {
targetLocation = getFileLocationOfEmptyTranslationUnit(modification.getTargetNode());
String currentFile = targetLocation.getFileName();
IPath implPath = new Path(currentFile);
- IFile relevantFile = ResourcesPlugin.getWorkspace().getRoot()
- .getFileForLocation(implPath);
+ IFile relevantFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(implPath);
+ if (relevantFile == null) { // if not in workspace
+ throw new UnhandledASTModificationException(modification);
+ }
MultiTextEdit edit;
if (changes.containsKey(relevantFile)) {
edit = changes.get(relevantFile);

Back to the top