mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 18:55:38 +02:00
Check for NPE
This commit is contained in:
parent
69a8947522
commit
1fefb24038
1 changed files with 9 additions and 5 deletions
|
@ -126,8 +126,12 @@ public class PathEntryStore extends AbstractCExtension implements IPathEntryStor
|
||||||
}
|
}
|
||||||
|
|
||||||
// get path and ensure it is absolute
|
// get path and ensure it is absolute
|
||||||
//String pathAttr = element.getAttribute(ATTRIBUTE_PATH);
|
IPath path;
|
||||||
IPath path = new Path(element.getAttribute(ATTRIBUTE_PATH));
|
if (element.hasAttribute(ATTRIBUTE_PATH)) {
|
||||||
|
path = new Path(element.getAttribute(ATTRIBUTE_PATH));
|
||||||
|
} else {
|
||||||
|
path = new Path(""); //$NON-NLS-1$
|
||||||
|
}
|
||||||
if (!path.isAbsolute()) {
|
if (!path.isAbsolute()) {
|
||||||
path = projectPath.append(path);
|
path = projectPath.append(path);
|
||||||
}
|
}
|
||||||
|
@ -165,7 +169,7 @@ public class PathEntryStore extends AbstractCExtension implements IPathEntryStor
|
||||||
case IPathEntry.CDT_PROJECT :
|
case IPathEntry.CDT_PROJECT :
|
||||||
return CoreModel.newProjectEntry(path, isExported);
|
return CoreModel.newProjectEntry(path, isExported);
|
||||||
case IPathEntry.CDT_LIBRARY :
|
case IPathEntry.CDT_LIBRARY :
|
||||||
if (!baseRef.isEmpty()) {
|
if (baseRef != null && !baseRef.isEmpty()) {
|
||||||
return CoreModel.newLibraryRefEntry(baseRef, path);
|
return CoreModel.newLibraryRefEntry(baseRef, path);
|
||||||
}
|
}
|
||||||
return CoreModel.newLibraryEntry(basePath, path, sourceAttachmentPath, sourceAttachmentRootPath,
|
return CoreModel.newLibraryEntry(basePath, path, sourceAttachmentPath, sourceAttachmentRootPath,
|
||||||
|
@ -195,7 +199,7 @@ public class PathEntryStore extends AbstractCExtension implements IPathEntryStor
|
||||||
if (element.hasAttribute(ATTRIBUTE_SYSTEM)) {
|
if (element.hasAttribute(ATTRIBUTE_SYSTEM)) {
|
||||||
isSystemInclude = element.getAttribute(ATTRIBUTE_SYSTEM).equals(VALUE_TRUE);
|
isSystemInclude = element.getAttribute(ATTRIBUTE_SYSTEM).equals(VALUE_TRUE);
|
||||||
}
|
}
|
||||||
if (!baseRef.isEmpty()) {
|
if (baseRef != null && !baseRef.isEmpty()) {
|
||||||
return CoreModel.newIncludeRefEntry(path, baseRef, includePath);
|
return CoreModel.newIncludeRefEntry(path, baseRef, includePath);
|
||||||
}
|
}
|
||||||
return CoreModel.newIncludeEntry(path, basePath, includePath, isSystemInclude, exclusionPatterns, isExported);
|
return CoreModel.newIncludeEntry(path, basePath, includePath, isSystemInclude, exclusionPatterns, isExported);
|
||||||
|
@ -204,7 +208,7 @@ public class PathEntryStore extends AbstractCExtension implements IPathEntryStor
|
||||||
{
|
{
|
||||||
String macroName = element.getAttribute(ATTRIBUTE_NAME);
|
String macroName = element.getAttribute(ATTRIBUTE_NAME);
|
||||||
String macroValue = element.getAttribute(ATTRIBUTE_VALUE);
|
String macroValue = element.getAttribute(ATTRIBUTE_VALUE);
|
||||||
if (!baseRef.isEmpty()) {
|
if (baseRef != null && !baseRef.isEmpty()) {
|
||||||
return CoreModel.newMacroRefEntry(path, baseRef, macroName);
|
return CoreModel.newMacroRefEntry(path, baseRef, macroName);
|
||||||
}
|
}
|
||||||
return CoreModel.newMacroEntry(path, macroName, macroValue, exclusionPatterns, isExported);
|
return CoreModel.newMacroEntry(path, macroName, macroValue, exclusionPatterns, isExported);
|
||||||
|
|
Loading…
Add table
Reference in a new issue