From 0715a63bd5d60987540aae85137696979dd15ecd Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Fri, 11 Apr 2014 10:14:34 -0400 Subject: [PATCH] fix for undefined method + for nil:NilClass for invalid paramters --- lib/logstash/agent.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/logstash/agent.rb b/lib/logstash/agent.rb index a266a6240..000d1ba4e 100644 --- a/lib/logstash/agent.rb +++ b/lib/logstash/agent.rb @@ -86,15 +86,17 @@ class LogStash::Agent < Clamp::Command configure # You must specify a config_string or config_path - if config_string.nil? && config_path.nil? + if @config_string.nil? && @config_path.nil? fail(help + "\n" + I18n.t("logstash.agent.missing-configuration")) end + @config_string = @config_string.to_s + if @config_path # Append the config string. # This allows users to provide both -f and -e flags. The combination # is rare, but useful for debugging. - @config_string = config_string + load_config(@config_path) + @config_string = @config_string + load_config(@config_path) else # include a default stdin input if no inputs given if @config_string !~ /input *{/