1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

FIXED - bug 246921: NPE in ChangeGenerator when extracting constant

https://bugs.eclipse.org/bugs/show_bug.cgi?id=246921 patch from Tom Ball
This commit is contained in:
Emanuel Graf 2008-09-11 19:29:59 +00:00
parent 91141bd408
commit 76159f066d

View file

@ -230,8 +230,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);