From c060993ca32fea36d37093fd5fad4d33906fa825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Mon, 23 Sep 2024 22:22:38 +0800 Subject: [PATCH] Fix bug. --- app/controllers/asks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/asks_controller.rb b/app/controllers/asks_controller.rb index 5ae9851..145b56f 100644 --- a/app/controllers/asks_controller.rb +++ b/app/controllers/asks_controller.rb @@ -207,7 +207,7 @@ class AsksController < ApplicationController all_to_save = [] ask_setting = AskCategorySetting.enabled.where(category_id: params['ask_question']['category_id']).first override_sort_number = nil - if ask_setting.use_default + if ask_setting && ask_setting.use_default override_sort_number = ask_setting.default_sort_number ask_setting = nil end