View Single Post
08-04-14, 07:24 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You're (probably) getting those errors because you don't currently have the buff active. I guess WeakAuras can't handle nil values itself (I don't actually use it) so just return a zero if UnitAura didn't return anything:
Code:
function()
     local _, _, _, _, _, duration, expirationTime = UnitBuff("player", "Blutschild")
     return expirationTime or 0
end
or:
Code:
function()
     local _, _, _, _, _, duration, expirationTime = UnitBuff("player", "Blutschild")
     return expirationTime and (expirationTime - GetTime()) or 0
end
Again, as I don't actually use WeakAuras, I don't know whether it needs the remaining time or the expiration time, but either of the above should make sure it doesn't receive any scary nil values.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote