summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-12-22 13:53:47 +0100
committerJon Marius Venstad <venstad@gmail.com>2021-12-22 13:53:47 +0100
commit93de1e70997a1075cfc7cb8a61f13c1e9fee238c (patch)
tree5321437490e4eec04a271d1fb57d315f05bc3367 /vespaclient-container-plugin
parent3681a41fbe88c3b4961a74d1318f77cc59c1c670 (diff)
Guard against wrong class of message
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java
index 3762d52ba19..2fbb80d9fcc 100644
--- a/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java
+++ b/vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java
@@ -15,9 +15,13 @@ import com.yahoo.vespa.http.client.core.ErrorCode;
import com.yahoo.vespa.http.client.core.OperationStatus;
import java.util.Map;
+import java.util.Optional;
+import java.util.function.Predicate;
import java.util.logging.Level;
import java.util.logging.Logger;
+import static java.util.function.Predicate.not;
+
/**
* Catch message bus replies and make the available to a given session.
*
@@ -71,6 +75,8 @@ public class FeedReplyReader implements ReplyHandler {
private static boolean updateNotFound(Reply reply) {
return reply instanceof UpdateDocumentReply
&& ! ((UpdateDocumentReply) reply).wasFound()
+ && reply.getMessage() instanceof UpdateDocumentMessage
+ && ((UpdateDocumentMessage) reply.getMessage()).getDocumentUpdate() != null
&& ! ((UpdateDocumentMessage) reply.getMessage()).getDocumentUpdate().getCreateIfNonExistent();
}