summaryrefslogtreecommitdiff
path: root/lib/chef/event_dispatch/dispatcher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/event_dispatch/dispatcher.rb')
-rw-r--r--lib/chef/event_dispatch/dispatcher.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/event_dispatch/dispatcher.rb b/lib/chef/event_dispatch/dispatcher.rb
index 966a3f32ec..f3e55539a9 100644
--- a/lib/chef/event_dispatch/dispatcher.rb
+++ b/lib/chef/event_dispatch/dispatcher.rb
@@ -32,8 +32,11 @@ class Chef
mth = s.method(method_name)
# Trim arguments to match what the subscriber expects to allow
# adding new arguments without breaking compat.
- args = args.take(mth.arity) if mth.arity < args.size && mth.arity >= 0
- mth.call(*args)
+ if mth.arity < args.size && mth.arity >= 0
+ mth.call(*args.take(mth.arity))
+ else
+ mth.call(*args)
+ end
end
end