diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-07-10 21:05:35 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-07-10 21:05:35 +0000 |
commit | 60e07b9bb31a11475981576f254c7905273f093e (patch) | |
tree | ecd66888fcf25d387d889ebc72bb22ede79b36e0 /app/controllers/settings_controller.rb | |
parent | 48259a1eda50494eea63830d6e747d4b602b7631 (diff) | |
download | redmine-60e07b9bb31a11475981576f254c7905273f093e.tar.gz redmine-60e07b9bb31a11475981576f254c7905273f093e.zip |
Don't error when posting empty plugin settings (#26393).
git-svn-id: http://svn.redmine.org/redmine/trunk@16812 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/settings_controller.rb')
-rw-r--r-- | app/controllers/settings_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index 51ab871ca..7b2dceb31 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -67,7 +67,8 @@ class SettingsController < ApplicationController end if request.post? - Setting.send "plugin_#{@plugin.id}=", params[:settings].permit!.to_h + setting = params[:settings] ? params[:settings].permit!.to_h : {} + Setting.send "plugin_#{@plugin.id}=", setting flash[:notice] = l(:notice_successful_update) redirect_to plugin_settings_path(@plugin) else |