Error in cooldown.lua - attempt to index a nil value
Erydana opened this issue ยท 2 comments
The following error was caught by swatter while I was fighting three mobs at once (Paladin, Retr, level 100)
OmniCC: 6.0.10
Date: 2014-12-24 14:17:39
ID: 1
Error occured in: Global
Count: 241
Message: ..\AddOns\OmniCC\core\cooldown.lua line 92:
attempt to index a nil value
Debug:
OmniCC\core\cooldown.lua:92: UpdateAlpha()
OmniCC\core\cooldown.lua:12:
OmniCC\core\cooldown.lua:11
[C]: SetCooldown()
..\FrameXML\LossOfControlFrame.lua:124: LossOfControlFrame_SetUpDisplay()
..\FrameXML\LossOfControlFrame.lua:52:
..\FrameXML\LossOfControlFrame.lua:37
Locals:
self = <unnamed> {
0 = <userdata>
}
(*temporary) = nil
(*temporary) = OmniCC {
0 = <userdata>
UpdateGroups = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:81
Cache = <table> {
}
SetupEvents = <function> defined @Interface\AddOns\OmniCC\main.lua:43
FindGroup = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:30
GetGroupIndex = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:49
VARIABLES_LOADED = <function> defined @Interface\AddOns\OmniCC\main.lua:25
GetGroupSettingsFor = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:11
New = <function> defined @Interface\AddOns\OmniCC\main.lua:96
GetUpdateEngine = <function> defined @Interface\AddOns\OmniCC\effects\effects.lua:48
Meta = <table> {
}
GetEffect = <function> defined @Interface\AddOns\OmniCC\effects\effects.lua:24
UpgradeSettings = <function> defined @Interface\AddOns\OmniCC\settings\settings.lua:41
AddGroup = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:60
AniUpdater = <unnamed> {
}
RemoveGroup = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:70
SetupCommands = <function> defined @Interface\AddOns\OmniCC\main.lua:69
Cooldown = <unnamed> {
}
StartupSettings = <function> defined @Interface\AddOns\OmniCC\settings\settings.lua:25
GetGroupSettings = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:16
GetVersion = <function> defined @Interface\AddOns\OmniCC\settings\settings.lua:100
GetGroup = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:20
StartupGroup = <function> defined @Interface\AddOns\OmniCC\settings\settings.lua:51
Actions = <table> {
}
ScriptUpdater = <unnamed> {
}
TriggerEffect = <function> defined @Interface\AddOns\OmniCC\effects\effects.lua:9
SetupConfig = <function> defined @Interface\AddOns\OmniCC\main.lua:49
sets = <table> {
}
RegisterEffect = <function> defined @Interface\AddOns\OmniCC\effects\effects.lua:19
effects = <table> {
}
GetButtonIcon = <function> defined @Interface\AddOns\OmniCC\effects\effects.lua:31
SetupEffect = <function> defined @Interface\AddOns\OmniCC\effects\effects.lua:14
Startup = <function> defined @Interface\AddOns\OmniCC\main.lua:13
PLAYER_ENTERING_WORLD = <function> defined @Interface\AddOns\OmniCC\main.lua:89
Timer = <unnamed> {
}
GetSettingsVersion = <function> defined @Interface\AddOns\OmniCC\settings\settings.lua:104
ACTIONBAR_UPDATE_COOLDOWN = <function> defined @Interface\AddOns\OmniCC\main.lua:85
SetupHooks = <function> defined @Interface\AddOns\OmniCC\main.lua:35
}
(*temporary) = "Ignore"
(*temporary) = nil
(*temporary) = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:16
(*temporary) = OmniCC {
0 = <userdata>
UpdateGroups = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:81
Cache = <table> {
}
SetupEvents = <function> defined @Interface\AddOns\OmniCC\main.lua:43
FindGroup = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:30
GetGroupIndex = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:49
VARIABLES_LOADED = <function> defined @Interface\AddOns\OmniCC\main.lua:25
GetGroupSettingsFor = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:11
New = <function> defined @Interface\AddOns\OmniCC\main.lua:96
GetUpdateEngine = <function> defined @Interface\AddOns\OmniCC\effects\effects.lua:48
Meta = <table> {
}
GetEffect = <function> defined @Interface\AddOns\OmniCC\effects\effects.lua:24
UpgradeSettings = <function> defined @Interface\AddOns\OmniCC\settings\settings.lua:41
AddGroup = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:60
AniUpdater = <unnamed> {
}
RemoveGroup = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:70
SetupCommands = <function> defined @Interface\AddOns\OmniCC\main.lua:69
Cooldown = <unnamed> {
}
StartupSettings = <function> defined @Interface\AddOns\OmniCC\settings\settings.lua:25
GetGroupSettings = <function> defined @Interface\AddOns\OmniCC\settings\groups.lua:16
GetVersion = <function> defined @Interfa
This problem seems to persist through 6.1.0
However, I think I managed to fix this by adding a nullcheck (is it called nullcheks in Lua?) around the offending line.
Disclaimer: I have no experience with Lua or the WoW API whatsoever, I have no clue which side effects the following fix might have.
Anyway, here's the fix: In core/cooldown.lua, replace line 92 with the following:
if OmniCC:GetGroupSettingsFor(self) == nil then
local alpha = 1
else
local alpha = OmniCC:GetGroupSettingsFor(self).spiralOpacity * (self.omniA or 1)
end