Exception in LNR_Private.RawGetPlateType #4

  • EricTheDad created this issue Nov 30, 2022

    I'm not sure if this is new to version 10 of WoW, but the call to UnitReaction that gets called inside of LNR_Private.RawGetPlateType is capable of returning nil (in my case, it was when using the Better Fishing addon to double-click cast into a fish pool), causing an exception when reaction is checked against the various numeric values.  I should probably also mention that my version of LibNameplateRegistry comes from having H.H.T.D. installed.

    I fixed it by enclosing the numeric checks inside a nil check on reaction, like so

        if reaction then
            if reaction > 4 then
                reaction = 'FRIENDLY';
            elseif reaction > 2 then
                reaction = 'NEUTRAL';
                reaction = 'HOSTILE';

     This seems to work for my test case, but I'm not sure if all callers of LNR_Private.RawGetPlateType are able to handle the nil return.

  • EricTheDad edited description Nov 30, 2022

To post a comment, please login or register a new account.