• 0

    posted a message on LilSparky's Workshop -- Official Thread
    Hi, apologies if this issue is already fixed. I've found that if I have LSW set to "show value as percent" mode, I get an error on each startup, on line 1476 in lilsparkysworkshop.lua (attempt to compare NIL to 0). The following code is the issue (this is r77-beta):

    if LSWConfig.valueAsPercent then
    if (costAmount > 0 and valueAmount >= 0) then
    local per = valueAmount / costAmount

    The following change to the middle line fixes the problem:

    if ((costAmount or 0) > 0 and (valueAmount or 0) >= 0) then

    Alternatively I imagine this would work, and perhaps be cleaner:

    if (costAmount and valueAmount and costAmount > 0 and valueAmount >= 0) then

    With the change in place, I get "inf" until the initial price cache operation is complete, but once it's done everything looks good.

    If there's a better way to submit patches, please let me know. Thanks for a great addon!
    Posted in: General AddOns
  • To post a comment, please or register a new account.