From 66a74226c5aa6088397b516756aa4212adeb66b3 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 28 Nov 2024 09:20:44 +0100 Subject: [PATCH] do not run hooks if we have none defined --- lib/trocla/hooks.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/trocla/hooks.rb b/lib/trocla/hooks.rb index 09ab88e..b4e5b3d 100644 --- a/lib/trocla/hooks.rb +++ b/lib/trocla/hooks.rb @@ -7,6 +7,7 @@ def initialize(trocla) end def run(action, key, format, options) + return unless hooks[action] hooks[action].each do |cmd| Trocla::Hooks.send(cmd, trocla, key, format, options) end