diff options
author | 2021-08-16 02:16:36 +0200 | |
---|---|---|
committer | 2021-08-16 02:16:36 +0200 | |
commit | c690bb0cb218a40f888029da1f343521431a4386 (patch) | |
tree | b8e13f7586227afc89d085c69af7f7832984440e /model-data | |
parent | Removed data reference to domain classes (diff) | |
download | refinery-c690bb0cb218a40f888029da1f343521431a4386.tar.gz refinery-c690bb0cb218a40f888029da1f343521431a4386.tar.zst refinery-c690bb0cb218a40f888029da1f343521431a4386.zip |
Added validation for null tuples
Diffstat (limited to 'model-data')
-rw-r--r-- | model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/Relation.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/Relation.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/Relation.java index 79bd9661..eafb5c56 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/Relation.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/Relation.java | |||
@@ -24,6 +24,8 @@ public class Relation<D> extends DataRepresentation<Tuple, D> { | |||
24 | 24 | ||
25 | @Override | 25 | @Override |
26 | public boolean isValidKey(Tuple key) { | 26 | public boolean isValidKey(Tuple key) { |
27 | return key.getSize() == getArity(); | 27 | if(key == null) { |
28 | return false; | ||
29 | } else return key.getSize() == getArity(); | ||
28 | } | 30 | } |
29 | } | 31 | } |