[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 <sven.efftinge@itemis.de>
This commit is contained in:
Sven Efftinge 2015-04-22 16:19:15 +02:00
parent 8e042ce1a8
commit 2d18d6663e

View file

@ -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