diff --git a/lib/fluent/plugin/base.rb b/lib/fluent/plugin/base.rb index 3bd8f44224..ebd5786e2b 100644 --- a/lib/fluent/plugin/base.rb +++ b/lib/fluent/plugin/base.rb @@ -54,12 +54,9 @@ def fluentd_worker_id def configure(conf) if Fluent::Engine.supervisor_mode || (conf.respond_to?(:for_this_worker?) && conf.for_this_worker?) - workers = if conf.target_worker_ids && !conf.target_worker_ids.empty? - conf.target_worker_ids.size - else - 1 - end - system_config_override(workers: workers) + if !conf&.target_worker_ids&.empty? + system_config_override(workers: conf.target_worker_ids.size) + end end super(conf, system_config.strict_config_value) @_state ||= State.new(false, false, false, false, false, false, false, false, false)