Exception in LNR_Private.RawGetPlateType #4


  • Fixed
Closed
Assigned to archarodim
  • 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';
            else
                reaction = 'HOSTILE';
            end
        end
    

     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
  • archarodim closed issue Oct 22, 2023
  • archarodim posted a comment Oct 22, 2023

    Late thanks for this report! I totally forgot to check issues here. Of course this problem was fixed a long time ago now: https://github.com/2072/LibNameplateRegistry-1.0/commit/54749fe0d6f79f8d8bf15b340d3bf5feb17aacb5


    Edited Oct 22, 2023
  • archarodim self-assigned this issue Oct 22, 2023
  • archarodim added a tag Fixed Oct 22, 2023

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