### Eclipse Workspace Patch 1.0 #P org.eclipse.wst.common.modulecore Index: modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualResource.java =================================================================== RCS file: /cvsroot/webtools/common/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualResource.java,v retrieving revision 1.38 diff -u -r1.38 VirtualResource.java --- modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualResource.java 1 Apr 2008 19:49:41 -0000 1.38 +++ modulecore-src/org/eclipse/wst/common/componentcore/internal/resources/VirtualResource.java 11 Nov 2008 18:20:13 -0000 @@ -298,19 +298,22 @@ try { moduleCore = StructureEdit.getStructureEditForWrite(getProject()); WorkbenchComponent component = moduleCore.getComponent(); - ResourceTreeRoot root = ResourceTreeRoot.getDeployResourceTreeRoot(component); - ComponentResource[] resources = root.findModuleResources(getRuntimePath(), ResourceTreeNode.CREATE_NONE); - if (resources.length > 0) { - for (int resourceIndx = 0; resourceIndx < resources.length; resourceIndx++) { - if (aProjectRelativeLocation.makeAbsolute().equals(resources[resourceIndx].getSourcePath())) { - component.getResources().remove(resources[resourceIndx]); + if (component != null) { + ResourceTreeRoot root = ResourceTreeRoot.getDeployResourceTreeRoot(component); + ComponentResource[] resources = root.findModuleResources(getRuntimePath(), ResourceTreeNode.CREATE_NONE); + if (resources.length > 0) { + for (int resourceIndx = 0; resourceIndx < resources.length; resourceIndx++) { + if (aProjectRelativeLocation.makeAbsolute().equals(resources[resourceIndx].getSourcePath())) { + component.getResources().remove(resources[resourceIndx]); + } } } } } finally { if (moduleCore != null) { - moduleCore.saveIfNecessary(monitor); + if (component != null) + moduleCore.saveIfNecessary(monitor); moduleCore.dispose(); } }