lib/docman/commands/command.rb in docman-0.0.54 vs lib/docman/commands/command.rb in docman-0.0.55
- old
+ new
@@ -46,10 +46,10 @@
add_actions(self, @context)
add_actions(@context, @context) if @context
end
def add_actions(obj, context = nil)
- if obj.has_key? 'hooks' and obj['hooks'].has_key? @type and obj['hooks'][@type]
+ if obj.has_key? 'hooks' and obj['hooks'].has_key? @type and not obj['hooks'][@type].nil?
obj['hooks'][@type].each_pair do |name, hooks|
hooks = Marshal::load(Marshal.dump(hooks))
unless context.nil?
hooks.each do |hook|
hook['context'] = context
\ No newline at end of file