[classic]Error in function `GetMinimapShape', attempt to index upvalue 'db' (a nil value)
marsdonne opened this issue ยท 3 comments
Message: Interface\AddOns\SexyMap\Shapes.lua:354: attempt to index upvalue 'db' (a nil value)
Time: Sun Feb 23 09:47:54 2020
Count: 1
Stack: Interface\AddOns\SexyMap\Shapes.lua:354: attempt to index upvalue 'db' (a nil value)
Interface\AddOns\SexyMap\Shapes.lua:354: in function GetMinimapShape' ...tlasLootClassic\Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua:126: in function <...tlasLootClassic\Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua:121> ...tlasLootClassic\Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua:369: in function
Refresh'
Interface\AddOns\DruidBarClassic\DruidBar.lua:72: in function `DruidBar_OnEvent'
[string ":OnEvent"]:1: in function <[string ":OnEvent"]:1>
Locals: (*temporary) =
{Interface\AddOns\SexyMap\shapes\route66 =
}
Interface\AddOns\SexyMap\shapes\hexagon =
}
Interface\AddOns\SexyMap\shapes\top.tga =
}
ENVIRONMENTS\STARS\Deathsky_Mask =
}
SPELLS\T_VFX_BORDER =
}
Interface\AddOns\SexyMap\shapes\bottom.tga =
}
Interface\AddOns\SexyMap\shapes\octagon =
}
Interface\AddOns\SexyMap\shapes\largecircle =
}
Interface\AddOns\SexyMap\shapes\left.tga =
}
Interface\AddOns\SexyMap\shapes\snowflake =
}
Interface\AddOns\SexyMap\shapes\right.tga =
}
Interface\BUTTONS\WHITE8X8 =
}
Interface\AddOns\SexyMap\shapes\topleft =
}
Interface\AddOns\SexyMap\shapes\bottomright =
}
Interface\AddOns\SexyMap\shapes\circle.tga =
}
Interface\AddOns\SexyMap\shapes\bottomleft =
}
Interface\AddOns\SexyMap\shapes\heart =
}
Interface\AddOns\SexyMap\shapes\topright =
}
Interface\AddOns\SexyMap\shapes\diamond =
}
}
(*temporary) = nil
(*temporary) = "attempt to index upvalue 'db' (a nil value)"
shapes =
Interface\AddOns\SexyMap\shapes\route66 =
}
Interface\AddOns\SexyMap\shapes\hexagon =
}
Interface\AddOns\SexyMap\shapes\top.tga =
}
ENVIRONMENTS\STARS\Deathsky_Mask =
}
SPELLS\T_VFX_BORDER =
}
Interface\AddOns\SexyMap\shapes\bottom.tga =
}
Interface\AddOns\SexyMap\shapes\octagon =
}
Interface\AddOns\SexyMap\shapes\largecircle =
}
Interface\AddOns\SexyMap\shapes\left.tga =
}
Interface\AddOns\SexyMap\shapes\snowflake =
}
Interface\AddOns\SexyMap\shapes\right.tga =
}
Interface\BUTTONS\WHITE8X8 =
}
Interface\AddOns\SexyMap\shapes\topleft =
}
Interface\AddOns\SexyMap\shapes\bottomright =
}
Interface\AddOns\SexyMap\shapes\circle.tga =
}
Interface\AddOns\SexyMap\shapes\bottomleft =
}
Interface\AddOns\SexyMap\shapes\heart =
}
Interface\AddOns\SexyMap\shapes\topright =
}
Interface\AddOns\SexyMap\shapes\diamond =
}
}
db = nil
This error appears when the addon Druid Bar Classic is also used so it's some kind of compatibility problem. When others reported this to the Druid Bar devs, they said the issue was with this addon (shrugs).
Date: 2021-02-21 21:53:10
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\SexyMap\Shapes.lua line 354:
attempt to index upvalue 'db' (a nil value)
Debug:
[C]: ?
SexyMap\Shapes.lua:354: GetMinimapShape()
...tlasLootClassic\Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua:126:
...tlasLootClassic\Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua:121
...tlasLootClassic\Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua:375: Refresh()
DruidBarClassic\DruidBar.lua:72: DruidBar_OnEvent()
[string ":OnEvent"]:1:
[string ":OnEvent"]:1
This error appears when the addon Druid Bar Classic is also used so it's some kind of compatibility problem. When others reported this to the Druid Bar devs, they said the issue was with this addon (shrugs).
They are partially correct. If they wanted, they could fix the issue by delaying their code scanning GetMinimapShape()
until PLAYER_LOGIN occurs, which in my opinion would be the correct implementation. However, the error occurs because SexyMap for classic defines GetMinimapShape()
before its settings database are initialized.
Essentially SexyMap assumes any addon requesting this function would actually wait until PLAYER_LOGIN, because scanning this function earlier than this increases the likelihood you're going to run code based off a wrong shape.
This assumption was changed in the retail version in this commit: 8481a12
It's unlikely this will be fixed for the classic version. I don't really have any interest in putting effort into a dead game.
It will be fixed for BC classic with a fresh branch from the retail version.