From 8caee099ede8be7b0d6ecc9e42d6fc4903885fc2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 15 Mar 2019 08:01:47 +0000 Subject: [PATCH] Merged r17960 to 4.0-stable (#31030). git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@17961 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/plugin.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 073eb3eb6..ccfb6c4d0 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -269,7 +269,11 @@ module Redmine arg = { :version_or_higher => arg } unless arg.is_a?(Hash) arg.assert_valid_keys(:version, :version_or_higher) - plugin = Plugin.find(plugin_name) + begin + plugin = Plugin.find(plugin_name) + rescue PluginNotFound + raise PluginRequirementError.new("#{id} plugin requires the #{plugin_name} plugin") + end current = plugin.version.split('.').collect(&:to_i) arg.each do |k, v| -- 2.39.5