diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-03-16 21:44:49 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2024-03-16 21:44:49 +0100 |
commit | 5d4e0ca1afd9c9722bbc840773f188146429ee09 (patch) | |
tree | 6dbc2dd89248a49031370eba5d96769800d74f3a | |
parent | 50d31e0bb2f8c46ddece8e392d6289dc4394cd51 (diff) |
Check that schema exists first.
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java index 01708333ed5..378907eafd7 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java @@ -314,12 +314,14 @@ public class ContentSearchCluster extends TreeConfigProducer<AnyConfigProducer> private boolean hasIndexingModeStreaming(NewDocumentType type) { if (indexedCluster == null) return false; - return indexedCluster.schemas().get(type.getName()).getIndexMode() == SchemaInfo.IndexMode.STREAMING; + var schemaInfo = indexedCluster.schemas().get(type.getName()); + return (schemaInfo != null) && (schemaInfo.getIndexMode() == SchemaInfo.IndexMode.STREAMING); } private boolean hasIndexingModeIndexed(NewDocumentType type) { if (indexedCluster == null) return false; - return indexedCluster.schemas().get(type.getName()).getIndexMode() == SchemaInfo.IndexMode.INDEX; + var schemaInfo = indexedCluster.schemas().get(type.getName()); + return (schemaInfo != null) && (schemaInfo.getIndexMode() == SchemaInfo.IndexMode.INDEX); } private boolean hasIndexingModeStoreOnly(NewDocumentType type) { |