Skip to content

Commit

Permalink
Add nullable tag
Browse files Browse the repository at this point in the history
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
  • Loading branch information
gaobinlong committed Aug 14, 2023
1 parent 15d92b5 commit 2cea65b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.opensearch.ExceptionsHelper;
import org.opensearch.OpenSearchException;
import org.opensearch.OpenSearchParseException;
import org.opensearch.common.Nullable;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.common.xcontent.LoggingDeprecationHandler;
import org.opensearch.core.xcontent.MediaTypeRegistry;
Expand Down Expand Up @@ -510,7 +511,7 @@ public static Processor readProcessor(
Map<String, Processor.Factory> processorFactories,
ScriptService scriptService,
String type,
Object config
@Nullable Object config
) throws Exception {
if (config == null) {
throw newConfigurationException(type, null, null, "processor [" + type + "] cannot be null");
Expand All @@ -529,8 +530,11 @@ public static Processor readProcessor(
Map<String, Processor.Factory> processorFactories,
ScriptService scriptService,
String type,
Map<String, Object> config
@Nullable Map<String, Object> config
) throws Exception {
if (config == null) {
throw newConfigurationException(type, null, null, "expect the config of processor [" + type + "] to be map, but is null");
}
String tag = ConfigurationUtils.readOptionalStringProperty(null, null, config, TAG_KEY);
String description = ConfigurationUtils.readOptionalStringProperty(null, tag, config, DESCRIPTION_KEY);
boolean ignoreFailure = ConfigurationUtils.readBooleanProperty(null, null, config, IGNORE_FAILURE_KEY, false);
Expand Down

0 comments on commit 2cea65b

Please sign in to comment.