Ascension-Addons / WeakAuras

WeakAuras Backport for Ascension.gg
GNU General Public License v2.0
0 stars 5 forks source link

WA2 + Kpack Cooldowns Module nil issue #4

Closed kiriaziskokkinos closed 1 year ago

kiriaziskokkinos commented 1 year ago

Description

When using the Cooldowns module of Kpack, if an aura is setting the duration of an icon programmaticaly, it results in a nil error if the aura gets unloaded (disabled).

Adding a nil check for cooldown.expirationTime in the region:PreShow() function of Icon.lua fixes the issue.

Note that if the Cooldowns module from Kpack is not enabled, weakauras does not produce an error and works normaly.

Realm

Rexxar

Tested with only this addon

Lua Error

Message: ..\AddOns\WeakAuras\RegionTypes\Icon.lua line 589:
   attempt to perform arithmetic on field 'expirationTime' (a nil value)
Debug:
   [C]: ?
   WeakAuras\RegionTypes\Icon.lua:589: PreShow()
   ...ace\AddOns\WeakAuras\RegionTypes\RegionPrototype.lua:905: Expand()

Screenshot 2023-04-06 122108

Reproduction Steps

  1. Have Weakauras addon.
  2. Have Kpack addon with the Cooldowns module enabled ( unticked )
  3. Have a weakaura that sets the duration information with a custom function ( Example: https://weakauras.io/posts/253 )
  4. Check the 'Never" load condition of the aura

https://user-images.githubusercontent.com/18594410/230337473-42bbb0dc-03f2-44af-8a76-26b9612358d7.mp4

Last Good Version

No response

Screenshots

No response

andrew6180 commented 1 year ago

Thank you for the report!