mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
fixed npe
This commit is contained in:
parent
f84ad21f39
commit
1c182d0869
1 changed files with 5 additions and 4 deletions
|
@ -558,8 +558,9 @@ public class CDescriptor implements ICDescriptor {
|
||||||
return new IConfigurationElement[0];
|
return new IConfigurationElement[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public Element getProjectData(String id) throws CoreException {
|
public synchronized Element getProjectData(String id) throws CoreException {
|
||||||
NodeList nodes = getProjectDataDoc().getDocumentElement().getElementsByTagName(PROJECT_DATA_ITEM);
|
Document doc = getProjectDataDoc();
|
||||||
|
NodeList nodes = doc.getDocumentElement().getElementsByTagName(PROJECT_DATA_ITEM);
|
||||||
for (int i = 0; i < nodes.getLength(); ++i) {
|
for (int i = 0; i < nodes.getLength(); ++i) {
|
||||||
Element element = (Element)nodes.item(i);
|
Element element = (Element)nodes.item(i);
|
||||||
if (element.getAttribute(PROJECT_DATA_ID).equals(id))
|
if (element.getAttribute(PROJECT_DATA_ID).equals(id))
|
||||||
|
@ -567,9 +568,9 @@ public class CDescriptor implements ICDescriptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not found, make a new one
|
// Not found, make a new one
|
||||||
Element element = dataDoc.createElement(PROJECT_DATA_ITEM);
|
Element element = doc.createElement(PROJECT_DATA_ITEM);
|
||||||
element.setAttribute(PROJECT_DATA_ID, id);
|
element.setAttribute(PROJECT_DATA_ID, id);
|
||||||
dataDoc.getDocumentElement().appendChild(element);
|
doc.getDocumentElement().appendChild(element);
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue