mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 515343 - NPE in NamespaceHelper.checkFileNameAndLocation()
Change-Id: Id281e1cd8ec189e214dcfeffb6d238b66c87050e
This commit is contained in:
parent
121d748c2c
commit
d4841209b5
1 changed files with 6 additions and 1 deletions
|
@ -18,6 +18,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode.CopyStyle;
|
||||
|
@ -79,7 +80,11 @@ public class NamespaceHelper {
|
|||
}
|
||||
|
||||
private static boolean checkFileNameAndLocation(final IPath path, final int offset, IASTNode namespace) {
|
||||
boolean fileNameOk = namespace.getFileLocation().getFileName().endsWith(path.toOSString());
|
||||
IASTFileLocation fileLoc = namespace.getFileLocation();
|
||||
if (fileLoc == null) {
|
||||
return false;
|
||||
}
|
||||
boolean fileNameOk = fileLoc.getFileName().endsWith(path.toOSString());
|
||||
if (!fileNameOk) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue