Skip to content

Commit

Permalink
avoid npe
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvg committed May 6, 2024
1 parent c8a03f7 commit 8e7de1d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ protected void masterOperation(
// Sniffing logic instead of invoking sourceAsMap(), which would materialize the entire mapping as map of maps.
int numberOfRollupIndices = 0;
for (var imd : state.metadata()) {
if (imd.mapping() == null) {
continue;
}

try (var parser = XContentHelper.createParser(PARSER_CONFIGURATION, imd.mapping().source().compressedReference())) {
if (parser.nextToken() == XContentParser.Token.START_OBJECT) {
if ("_doc".equals(parser.nextFieldName())) {
Expand Down

0 comments on commit 8e7de1d

Please sign in to comment.