Skip to content

Commit

Permalink
FIX: use safe navigation operator for params
Browse files Browse the repository at this point in the history
  • Loading branch information
Faizaan Gagan committed Dec 27, 2023
1 parent be71ec4 commit 8e9a912
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module DiscourseTopicVoting
module CategoriesControllerExtension
def category_params
@vote_enabled ||=
!!ActiveRecord::Type::Boolean.new.cast(params[:custom_fields][:enable_topic_voting])
!!ActiveRecord::Type::Boolean.new.cast(params&.[](:custom_fields)&.[](:enable_topic_voting))

category_params = super

Expand Down

0 comments on commit 8e9a912

Please sign in to comment.