Contextual adapters must throw instead of returning null
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / chart / property / ObtainedDoubleAdapter.java
index 79f32fcd2fee1e144bdd89e25e4317ecfdfc5ff7..ff257169ca01e1272b57e62ff1dd259d82aa6601 100644 (file)
@@ -20,6 +20,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;
@@ -46,7 +47,7 @@ public class ObtainedDoubleAdapter extends SimpleContextualAdapter<Double, Relat
                 return result;
         }
 
-        return null;
+        throw new AdaptionException("No obtained double available");
     }
 
 }