diff --git a/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java index cd3242e98a2d7..a724cbb5f1dec 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java @@ -168,6 +168,9 @@ protected boolean processField(RootObjectMapper.Builder builder, String fieldNam } ] */ + if (!(fieldNode instanceof List)) { + throw new MapperParsingException("Dynamic template syntax error"); + } List tmplNodes = (List) fieldNode; List templates = new ArrayList<>(); for (Object tmplNode : tmplNodes) {