-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty locale cookie crashes rendering #74
Comments
Merged
The locale was empty because the account was created by command. I added an validation, that validates empty and correct locales, because I don't know, whether there are empty ones in the production system |
That makes sense. I just looked into the production db. Currently there are no users with missing or incorrect locales. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you supply an empty locale cookie 🥠 (done by accident while testing), the application renders an error and is unusable.
The culprit is here https://github.com/fosterfarrell9/mampf/blob/f117f860a277e6219183861605c0aadc17f4fb58/app/controllers/application_controller.rb#L80
This causes the
enforce_available_locales!
to crash, because the locale "" is unknown.A possible way to mitigate this, would be:
The text was updated successfully, but these errors were encountered: