aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-03-16 21:44:49 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2024-03-16 21:44:49 +0100
commit5d4e0ca1afd9c9722bbc840773f188146429ee09 (patch)
tree6dbc2dd89248a49031370eba5d96769800d74f3a
parent50d31e0bb2f8c46ddece8e392d6289dc4394cd51 (diff)
Check that schema exists first.
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/content/ContentSearchCluster.java6
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) {