From ea9b10d112d62bfa7a60886a00f9774fff0da3d7 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 6 Jan 2025 11:16:42 +0100 Subject: [PATCH] Fix error 500 when passing an invalid `lang` parameter (#33467) --- app/controllers/concerns/localized.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/localized.rb b/app/controllers/concerns/localized.rb index ede299d5a4..14742e3b5c 100644 --- a/app/controllers/concerns/localized.rb +++ b/app/controllers/concerns/localized.rb @@ -25,7 +25,7 @@ module Localized end def available_locale_or_nil(locale_name) - locale_name.to_sym if locale_name.present? && I18n.available_locales.include?(locale_name.to_sym) + locale_name.to_sym if locale_name.respond_to?(:to_sym) && I18n.available_locales.include?(locale_name.to_sym) end def content_locale