Fix crash during Configure. Fixes #24
This commit is contained in:
@@ -67,6 +67,7 @@ func loadStorage(force bool) {
|
|||||||
if _, ok := globalConfig.storage.Domains[globalConfig.domain]; !ok || force {
|
if _, ok := globalConfig.storage.Domains[globalConfig.domain]; !ok || force {
|
||||||
globalConfig.storage.AddDomain(globalConfig.domain)
|
globalConfig.storage.AddDomain(globalConfig.domain)
|
||||||
}
|
}
|
||||||
|
globalConfig.storage.SetDomain(globalConfig.domain)
|
||||||
|
|
||||||
globalConfig.Unlock()
|
globalConfig.Unlock()
|
||||||
}
|
}
|
||||||
@@ -143,12 +144,9 @@ func SetLibrary(lib string) {
|
|||||||
// as using each setter will introduce a I/O overhead because the Translation file will be loaded after each set.
|
// as using each setter will introduce a I/O overhead because the Translation file will be loaded after each set.
|
||||||
func Configure(lib, lang, dom string) {
|
func Configure(lib, lang, dom string) {
|
||||||
globalConfig.Lock()
|
globalConfig.Lock()
|
||||||
|
|
||||||
globalConfig.library = lib
|
globalConfig.library = lib
|
||||||
globalConfig.language = SimplifiedLocale(lang)
|
globalConfig.language = SimplifiedLocale(lang)
|
||||||
globalConfig.domain = dom
|
globalConfig.domain = dom
|
||||||
globalConfig.storage.SetDomain(dom)
|
|
||||||
|
|
||||||
globalConfig.Unlock()
|
globalConfig.Unlock()
|
||||||
|
|
||||||
loadStorage(true)
|
loadStorage(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user