lib/docman/commands/command.rb in docman-0.0.55 vs lib/docman/commands/command.rb in docman-0.0.56
- old
+ new
@@ -49,10 +49,10 @@
def add_actions(obj, context = nil)
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?
+ unless context.nil? or hooks.nil?
hooks.each do |hook|
hook['context'] = context
end
end
if @hooks[name].nil?
\ No newline at end of file