diff --git a/lib/vagrant/action/warden.rb b/lib/vagrant/action/warden.rb index a0be5fe89..f531be079 100644 --- a/lib/vagrant/action/warden.rb +++ b/lib/vagrant/action/warden.rb @@ -100,14 +100,13 @@ module Vagrant # a `nil` args will actually pass `nil` into the class. args ||= [] - if klass.is_a?(Class) # A action klass which is to be instantiated with the # app, env, and any arguments given # We wrap the action class in two Trigger method calls so that # action triggers can fire before and after each given action in the stack. - klass_name = klass.name.to_sym + klass_name = klass.name [Vagrant::Action::Builtin::BeforeTriggerAction.new(self, env, klass_name, @triggers), diff --git a/lib/vagrant/plugin/v2/trigger.rb b/lib/vagrant/plugin/v2/trigger.rb index 936a303c7..93f371d83 100644 --- a/lib/vagrant/plugin/v2/trigger.rb +++ b/lib/vagrant/plugin/v2/trigger.rb @@ -42,6 +42,13 @@ module Vagrant return end + if !action + @logger.warn("Action given is nil, no triggers will fire") + return + else + action = action.to_sym + end + # get all triggers matching action triggers = [] if stage == :before