Skip to content
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

nil reference exception if localization text is empty #207

Closed
MJacred opened this issue Jan 3, 2020 · 0 comments · Fixed by #208
Closed

nil reference exception if localization text is empty #207

MJacred opened this issue Jan 3, 2020 · 0 comments · Fixed by #208

Comments

@MJacred
Copy link
Contributor

MJacred commented Jan 3, 2020

Reproduction steps:

have a localization file, e.g. active.en.toml, with the content Test = "" and run the following command in your terminal in the appropriate directory:

goi18n merge active.*.toml

to generate your updated translate.*.toml files.

Analysis

The execution of the above mentioned command will cause a nil reference exception here

if sourceMessageTemplates[template.ID] != nil {

because a nil value was added here
templates[m.ID] = i18n.NewMessageTemplate(m)

MJacred pushed a commit to cubiest/go-i18n that referenced this issue Jan 3, 2020
MJacred pushed a commit to cubiest/go-i18n that referenced this issue Jan 3, 2020
MJacred pushed a commit to cubiest/go-i18n that referenced this issue Jan 3, 2020
MJacred pushed a commit to cubiest/go-i18n that referenced this issue Jan 3, 2020
MJacred added a commit to cubiest/go-i18n that referenced this issue Jan 3, 2020
MJacred added a commit to cubiest/go-i18n that referenced this issue Jan 3, 2020
MJacred added a commit to cubiest/go-i18n that referenced this issue Jan 9, 2020
MJacred added a commit to cubiest/go-i18n that referenced this issue Jan 9, 2020
MJacred added a commit to cubiest/go-i18n that referenced this issue Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant