Fix error 500 when passing an invalid lang parameter (#33467)

This commit is contained in:
Claire 2025-01-06 11:16:42 +01:00 committed by GitHub
parent dbbf450ef5
commit ea9b10d112
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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