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

Bug 133881 - Make refreshing after building optional : Protect against a NPE and a ResourceException

This commit is contained in:
Marc-Andre Laperle 2011-04-30 00:48:21 +00:00
parent 91ab5f5876
commit 31c799769a

View file

@ -325,6 +325,9 @@ public class RefreshScopeManager {
getProjectToResourcesMap(); getProjectToResourcesMap();
getResourcesToExclusionsMap(); getResourcesToExclusionsMap();
for(IProject project : fProjectToResourcesMap.keySet()) { for(IProject project : fProjectToResourcesMap.keySet()) {
if (!project.exists()) {
continue;
}
// serialize all settings for the project to an XML document which we will use to persist // serialize all settings for the project to an XML document which we will use to persist
// the data to a persistent resource property // the data to a persistent resource property
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
@ -352,8 +355,11 @@ public class RefreshScopeManager {
root.appendChild(resourceElement); root.appendChild(resourceElement);
// populate the node with any exclusions // populate the node with any exclusions
for(RefreshExclusion exclusion : fResourceToExclusionsMap.get(resource)) { List<RefreshExclusion> exclusions = fResourceToExclusionsMap.get(resource);
exclusion.persistData(doc, resourceElement); if (exclusions != null) {
for(RefreshExclusion exclusion : exclusions) {
exclusion.persistData(doc, resourceElement);
}
} }
} }