Skip to content

Commit 2cea65b

Browse files
committed
Add nullable tag
Signed-off-by: Gao Binlong <[email protected]>
1 parent 15d92b5 commit 2cea65b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.opensearch.ExceptionsHelper;
3838
import org.opensearch.OpenSearchException;
3939
import org.opensearch.OpenSearchParseException;
40+
import org.opensearch.common.Nullable;
4041
import org.opensearch.core.common.bytes.BytesReference;
4142
import org.opensearch.common.xcontent.LoggingDeprecationHandler;
4243
import 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

Comments
 (0)