From 28190fa018f26cace2b4572c4698d55de81d52f1 Mon Sep 17 00:00:00 2001 From: Geir Storli Date: Fri, 1 Feb 2019 14:47:38 +0000 Subject: Only apply modify update if current tensor is set. --- .../src/vespa/searchcore/proton/common/attribute_updater.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp b/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp index 060f991d9ac..3ad838c595b 100644 --- a/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp +++ b/searchcore/src/vespa/searchcore/proton/common/attribute_updater.cpp @@ -209,9 +209,11 @@ void applyTensorModifyUpdate(TensorAttribute &vec, uint32_t lid, const TensorModifyUpdate &update) { auto oldTensor = vec.getTensor(lid); - auto newTensor = update.applyTo(*oldTensor); - if (newTensor) { - vec.setTensor(lid, *newTensor); + if (oldTensor) { + auto newTensor = update.applyTo(*oldTensor); + if (newTensor) { + vec.setTensor(lid, *newTensor); + } } } -- cgit v1.2.3