You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using validation manually, not providing the Language field in the validation.Options will trigger a panic: runtime error: invalid memory address or nil pointer dereference.
We should load the built-in default language (en-US) if the option is omitted. Or we could use an empty language that would return only the name of the entry.
Possible drawbacks
Loading the default language for every validation can reduce performance a bit. This would still be very much recommended to use the option. This would need to be properly documented.
The text was updated successfully, but these errors were encountered:
As you suggested in the discusion on Discord, we could also detect if a language is been given. If not, we just return the entry name/input-as-is without translation, thus not using a language lookup in validator.go:processAddedErrors().
Proposal
When using validation manually, not providing the
Language
field in thevalidation.Options
will trigger apanic: runtime error: invalid memory address or nil pointer dereference
.We should load the built-in default language (
en-US
) if the option is omitted. Or we could use an empty language that would return only the name of the entry.Possible drawbacks
Loading the default language for every validation can reduce performance a bit. This would still be very much recommended to use the option. This would need to be properly documented.
The text was updated successfully, but these errors were encountered: