Error when using GetMapInfo
I recently updated my addon Historia to BFA.
All is working fine but there is one error I can't solve. Its when I get a loading screen and then end up in a zone I haven't been before. I get an error. Lua Code:
I understand the error but what I do not ouderstand is WHY I am getting it. If statement in line 11 (line 326 in the full addon) should prevent it. When executing the addon it will print the currentMapId as being nil and it will print the number 1. Think I must be missing something here :confused: Lua Code:
|
You aren't checking if currentMapId is nil the second time you call the function.
|
@Semlar
You lost me there. What second time? |
You call MapUtil.GetMapParentInfo twice in your code; once in the first block, after checking that currentMapId is not nil, and again later on without checking it.
We don't have your whole code so don't have the line numbers, but it's fully possible that the first block is executing correctly, followed by the second block throwing the error. |
Since both cases are basically identical in how they are handled:
Code:
function private_table.eventFrame:UI_INFO_MESSAGE(messageType) |
Solved
Thank you Vrul.
Its working now. Also taught me a bit about more effecient coding :) |
All times are GMT -6. The time now is 12:30 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI