From 2d18d6663ede1c838dca69f4904012321d285343 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Wed, 22 Apr 2015 16:19:15 +0200 Subject: [PATCH] [bug 464762] Handle cases where resolve returns a detached proxy itself Made PortableURIs more robust against EObjects without eResource. Also fixed the cause, which was BatchLinkingService returning proxies instead of null, when something couldn't be resolved. Signed-off-by: Sven Efftinge --- .../org/eclipse/xtext/resource/persistence/PortableURIs.xtend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/resource/persistence/PortableURIs.xtend b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/resource/persistence/PortableURIs.xtend index 7c093893a..5aeff8747 100644 --- a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/resource/persistence/PortableURIs.xtend +++ b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/resource/persistence/PortableURIs.xtend @@ -89,7 +89,7 @@ class PortableURIs { def URI toPortableURI(StorageAwareResource sourceResource, URI targetURI) { val to = sourceResource.resourceSet.getResource(targetURI.trimFragment, false)?.getEObject(targetURI.fragment) // if it points to some registered ecore, there's no resourceSet and the result is not portable - if (to == null || to.eResource.resourceSet != null) { + if (to == null || to.eResource?.resourceSet != null) { val result = toPortableURI(sourceResource, to); if (result != null) { return result