commit | 50f9a3e4f1b4731bcab3c1a304cbb8f4cc20ad93 | [log] [tgz] |
---|---|---|
author | jlanuti <jlanuti> | Wed Jan 11 19:57:27 2006 +0000 |
committer | jlanuti <jlanuti> | Wed Jan 11 19:57:27 2006 +0000 |
tree | 475c411fc321ba77dac66c719376309e8c076c9f | |
parent | 1c24eb08dd0c83454e3afdc13a0e0ea690072ad0 [diff] |
[121631] null guards added
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/StructureEdit.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/StructureEdit.java index 99acf93..67951b2 100644 --- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/StructureEdit.java +++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/StructureEdit.java
@@ -279,24 +279,25 @@ IVirtualComponent targetComponent = null; IProject targetProject = null; - boolean isClassPathURI = ModuleURIUtil.isClassPathURI(referencedComponent.getHandle()); + URI uri = referencedComponent.getHandle(); + if (uri == null) + return null; + boolean isClassPathURI = ModuleURIUtil.isClassPathURI(uri); if( !isClassPathURI ){ try { - targetProject = StructureEdit.getContainingProject(referencedComponent.getHandle()); + targetProject = StructureEdit.getContainingProject(uri); } catch(UnresolveableURIException uurie) { //Ignore } // if the project cannot be resolved, assume it's local - really it probably deleted targetComponent = ComponentCore.createComponent(targetProject); - - }else{ String archiveType = ""; //$NON-NLS-1$ String archiveName = ""; //$NON-NLS-1$ try { - archiveType = ModuleURIUtil.getArchiveType(referencedComponent.getHandle()); - archiveName = ModuleURIUtil.getArchiveName(referencedComponent.getHandle()); + archiveType = ModuleURIUtil.getArchiveType(uri); + archiveName = ModuleURIUtil.getArchiveName(uri); } catch (UnresolveableURIException e) { //Ignore
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/impl/ModuleURIUtil.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/impl/ModuleURIUtil.java index 779eebf..71b0576 100644 --- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/impl/ModuleURIUtil.java +++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/impl/ModuleURIUtil.java
@@ -166,7 +166,7 @@ } public static boolean isClassPathURI(URI uri){ - if( PlatformURLModuleConnection.CLASSPATH.equals(uri.segment(0) )){ + if(uri!=null && PlatformURLModuleConnection.CLASSPATH.equals(uri.segment(0) )){ return true; } return false;