fix for undefined method + for nil:NilClass for invalid paramters

fixes https://logstash.jira.com/browse/LOGSTASH-2024