diff options
author | Jon Bratseth <bratseth@oath.com> | 2021-04-29 09:41:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 09:41:53 +0200 |
commit | 126d4f78c4464c79f3365c433890119306693102 (patch) | |
tree | 5cd940d6e214195ecab1b2309baa9efca38ff52e /vespajlib | |
parent | 4a7cf7e9b02062780a0ea88739974ffdfb999e4a (diff) | |
parent | 993a656985977b0507e21e630c43158d601c9d14 (diff) |
Merge pull request #17649 from vespa-engine/lesters/mixed-tensor-out-of-bounds-check
Java mixed tensor: don't throw out of bounds exception
Diffstat (limited to 'vespajlib')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/tensor/MixedTensor.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/MixedTensor.java b/vespajlib/src/main/java/com/yahoo/tensor/MixedTensor.java index 606509bbfd8..7631a2e4eab 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/MixedTensor.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/MixedTensor.java @@ -53,7 +53,7 @@ public class MixedTensor implements Tensor { @Override public double get(TensorAddress address) { long cellIndex = index.indexOf(address); - if (cellIndex < 0) + if (cellIndex < 0 || cellIndex >= cells.size()) return Double.NaN; Cell cell = cells.get((int)cellIndex); if ( ! address.equals(cell.getKey())) |