fix error

This commit is contained in:
chiu 2020-08-21 18:19:28 +08:00
parent 28a3321635
commit 5abf3f70e2
1 changed files with 3 additions and 0 deletions

View File

@ -276,6 +276,9 @@ class Admin::AsksController < OrbitAdminController
ask_setting = AskSetting.first
ask_setting = AskSetting.create() if ask_setting.nil?
end
if temp_params['custom_values'].nil?
temp_params['custom_values'] = {}
end
ask_setting.custom_fields.select{|k,v| v['type']=='file' || v['type']=='image'}.each do |k,v|
file = temp_params['custom_values'][k] rescue nil
if !file.blank?