Contextual adapters must throw instead of returning null
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / diagram / monitor / ObtainedExpressionAdapter.java
index 2d136e8abfbb1d942c44f5daa14f34da6d1d3c78..71988116da9782cd66ee8565ebbe31ce170b87a3 100644 (file)
@@ -9,6 +9,7 @@ import org.simantics.db.RelationContext;
 import org.simantics.db.Resource;
 import org.simantics.db.Statement;
 import org.simantics.db.common.adaption.SimpleContextualAdapter;
+import org.simantics.db.exception.AdaptionException;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.layer0.property.OrderedResource;
 import org.simantics.operation.Layer0X;
@@ -31,7 +32,7 @@ public class ObtainedExpressionAdapter extends SimpleContextualAdapter<String, R
                        if(result != null) return result;
                }
                
-               return null;
+               throw new AdaptionException("No obtained expression available");
                
        }