Skip to content

Commit

Permalink
Fix error on loading if trigger[name] is nil
Browse files Browse the repository at this point in the history
Couldn't actually reproduce that, and the user attached no settings.
But every other place checks for trigger[name] being not nil.

Ticket-Nr: 1161
  • Loading branch information
InfusOnWoW authored and Stanzilla committed Jul 30, 2018
1 parent 967d4ac commit 832be59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions WeakAuras/WeakAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ function WeakAuras.ConstructFunction(prototype, trigger, skipOptional)
if(arg.init and arg.init ~= "arg") then
init = init.."local "..name.." = "..arg.init.."\n";
end
local number = tonumber(trigger[name]);
local number = trigger[name] and tonumber(trigger[name]);
local test;
if(arg.type == "tristate") then
if(trigger["use_"..name] == false) then
Expand All @@ -585,7 +585,7 @@ function WeakAuras.ConstructFunction(prototype, trigger, skipOptional)
if(trigger["use_"..name] == false) then -- multi selection
test = "(";
local any = false;
if (trigger[name].multi) then
if (trigger[name] and trigger[name].multi) then
for value, _ in pairs(trigger[name].multi) do
if not arg.test then
test = test..name.."=="..(tonumber(value) or "[["..value.."]]").." or ";
Expand Down

0 comments on commit 832be59

Please sign in to comment.