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:
parent
91141bd408
commit
76159f066d
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue