3737import org .opensearch .ExceptionsHelper ;
3838import org .opensearch .OpenSearchException ;
3939import org .opensearch .OpenSearchParseException ;
40+ import org .opensearch .common .Nullable ;
4041import org .opensearch .core .common .bytes .BytesReference ;
4142import org .opensearch .common .xcontent .LoggingDeprecationHandler ;
4243import org .opensearch .core .xcontent .MediaTypeRegistry ;
@@ -510,7 +511,7 @@ public static Processor readProcessor(
510511 Map <String , Processor .Factory > processorFactories ,
511512 ScriptService scriptService ,
512513 String type ,
513- Object config
514+ @ Nullable Object config
514515 ) throws Exception {
515516 if (config == null ) {
516517 throw newConfigurationException (type , null , null , "processor [" + type + "] cannot be null" );
@@ -529,8 +530,11 @@ public static Processor readProcessor(
529530 Map <String , Processor .Factory > processorFactories ,
530531 ScriptService scriptService ,
531532 String type ,
532- Map <String , Object > config
533+ @ Nullable Map <String , Object > config
533534 ) throws Exception {
535+ if (config == null ) {
536+ throw newConfigurationException (type , null , null , "expect the config of processor [" + type + "] to be map, but is null" );
537+ }
534538 String tag = ConfigurationUtils .readOptionalStringProperty (null , null , config , TAG_KEY );
535539 String description = ConfigurationUtils .readOptionalStringProperty (null , tag , config , DESCRIPTION_KEY );
536540 boolean ignoreFailure = ConfigurationUtils .readBooleanProperty (null , null , config , IGNORE_FAILURE_KEY , false );
0 commit comments