Lua error on login since patch 9.2
cremor opened this issue ยท 10 comments
Since path 9.2 I always get this Lua error on the first login with a just started client. Later relogs or UI reloads do not trigger the error.
2x ChocolateBar\modules\CB_PlayedTime.lua:70: bad argument #2 to 'format' (string expected, got nil)
[string "=[C]"]: in function `format'
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:70: in function <ChocolateBar\modules\CB_PlayedTime.lua:65>
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:78: in function <ChocolateBar\modules\CB_PlayedTime.lua:77>
Locals:
(*temporary) = "%s-%s"
(*temporary) = nil
(*temporary) = nil
(*temporary) = "string expected, got nil"
Using ChocolateBar v3.8
A few debug infos:
Dump: value=GetPlayerInfoByGUID(UnitGUID("player"))
[1]="Paladin",
[2]="PALADIN",
[3]="Mensch",
[4]="Human",
[5]=2,
[6]="my char name",
[7]=""
Dump: value=GetNormalizedRealmName()
[1]="my realm name"
Since those values all look ok, and later relogs or UI reloads do not trigger the error, I assume it is just a timing error. The values are not yet available when the code is first executed.
I got this too so hopefully it's common enough to debug quickly.
No idea how you got the extra debug info but the rest of mine is the same.
[string "=[C]"]: in function `format'
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:70: in function <ChocolateBar\modules\CB_PlayedTime.lua:65>
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:78: in function <ChocolateBar\modules\CB_PlayedTime.lua:77>
Locals:
(*temporary) = "%s-%s"
(*temporary) = nil
(*temporary) = nil
(*temporary) = "string expected, got nil"
@Kiatra This is not fixed in v3.8.1!
2x ChocolateBar\modules\CB_PlayedTime.lua:70: bad argument #2 to 'format' (string expected, got nil)
[string "=[C]"]: in function `format'
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:70: in function <ChocolateBar\modules\CB_PlayedTime.lua:65>
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:78: in function <ChocolateBar\modules\CB_PlayedTime.lua:77>
Locals:
(*temporary) = "%s-%s"
(*temporary) = nil
(*temporary) = "Blackmoore"
(*temporary) = "string expected, got nil"
@Kiatra Sorry, but this is still not fixed in v3.8.2:
1x ChocolateBar\modules\CB_PlayedTime.lua:66: bad argument #2 to 'format' (string expected, got nil)
[string "=[C]"]: in function `format'
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:66: in function <ChocolateBar\modules\CB_PlayedTime.lua:60>
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:74: in function <ChocolateBar\modules\CB_PlayedTime.lua:73>
Locals:
(*temporary) = "%s-%s"
(*temporary) = nil
(*temporary) = "Blackmoore"
(*temporary) = "string expected, got nil"
You changed the function onEnteringWorld
, but the error actually comes from the call in the function playedTimeEvent
.
@cremor, in 3.8.2 The function onEnteringWorld got a 2 second timer delay on the call for RequestTimePlayed() this triggers the playedTimeEvent. That fixed it for me.
I tried a different API in UnitFullName("player") for the getting the char name and realm, that seems more stable in the latest commit 1667113 can you tray that one out before I release it?
Sorry for not replying earlier, but I couldn't test until now.
I just tested 3.8.3 and it seems to fix the problem, thanks!
@Kiatra Bad news. While the error on login seems to be fixed, I just got a new - but similar - error when using my hearthstone.
This time it's the realm name that is nil.
1x ChocolateBar\modules\CB_PlayedTime.lua:62: bad argument #3 to 'format' (string expected, got nil)
[string "=[C]"]: in function `format'
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:62: in function <ChocolateBar\modules\CB_PlayedTime.lua:60>
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:86: in function <ChocolateBar\modules\CB_PlayedTime.lua:85>
[string "@ChocolateBar\modules\CB_PlayedTime.lua"]:98: in function `func'
[string "@BagSync\libs\AceTimer-3.0\AceTimer-3.0-17.lua"]:57: in function <...ceBagSync\libs\AceTimer-3.0\AceTimer-3.0.lua:50>
Locals:
(*temporary) = "%s-%s"
(*temporary) = "Cremor"
(*temporary) = nil
(*temporary) = "string expected, got nil"