From 8276d85bf9fad2f271a26452cb46f4f8703173ab Mon Sep 17 00:00:00 2001 From: lempinen Date: Thu, 11 Oct 2012 06:38:02 +0000 Subject: [PATCH] Changed RelatedOrderedSetElementsAccessor to return an empty list if the Element has no statements (i.e. it has been removed). (fixes #3771) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25977 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../rules/domain/RelatedOrderedSetElementsAccessor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.simantics.objmap/src/org/simantics/objmap/rules/domain/RelatedOrderedSetElementsAccessor.java b/org.simantics.objmap/src/org/simantics/objmap/rules/domain/RelatedOrderedSetElementsAccessor.java index a92d2d27..35c5e3f8 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/rules/domain/RelatedOrderedSetElementsAccessor.java +++ b/org.simantics.objmap/src/org/simantics/objmap/rules/domain/RelatedOrderedSetElementsAccessor.java @@ -12,6 +12,7 @@ package org.simantics.objmap.rules.domain; import java.util.Collection; +import java.util.Collections; import org.apache.log4j.Logger; import org.simantics.db.ReadGraph; @@ -40,7 +41,10 @@ public class RelatedOrderedSetElementsAccessor implements IDomainAccessor get(ReadGraph g, Resource element) throws MappingException { try { LOGGER.info(" RelatedOrderedSetElementsAccessor.get"); - return OrderedSetUtils.toList(g, element); + if(g.hasStatement(element)) + return OrderedSetUtils.toList(g, element); + else + return Collections.emptyList(); } catch (DatabaseException e) { throw new MappingException(e); } -- 2.47.1