Have I Done That?

2 - error when starting wow

What is the issue?
I get an error when I start wow something about a bad argument.  Please see below for said error
Please provide any additional information below.

Date: 2014-03-02 12:43:57
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\HaveIDoneThat\compare.lua line 24:
   bad argument #1 to 'strsub' (string expected, got nil)
Debug:
   [C]: strsub()
   HaveIDoneThat\compare.lua:24 in main chunk
Locals:
(*temporary) = nil
(*temporary) = 3
(*temporary) = "string expected, got nil"

User When Change
juslar_10 Mar 02, 2014 at 17:47 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 2 comments
  • Avatar of Phanx Phanx Aug 26, 2014 at 01:14 UTC - 0 likes

    Since there's still no official fix (stop ignoring your BugSack, Kemayo!) here's the unoffical one I've been using.

    In compare.lua, change this:

    function mod:OnLoad()
        self:InitDB()
    
        player_guid = strsub(UnitGUID("player"), 3)
    
        for tooltip in pairs(hook_tooltips) do
            hooksecurefunc(tooltip, "SetHyperlink", self.OnSetHyperlink)
            hooksecurefunc(tooltip, "Hide", self.OnTooltipHide)
        end
    end
    

    to this:

    function mod:OnLoad()
        self:InitDB()
    end
    
    function mod:OnLogin()
        player_guid = strsub(UnitGUID("player"), 3)
    
        for tooltip in pairs(hook_tooltips) do
            hooksecurefunc(tooltip, "SetHyperlink", self.OnSetHyperlink)
            hooksecurefunc(tooltip, "Hide", self.OnTooltipHide)
        end
    end
    
    Last edited Aug 26, 2014 by Phanx
  • Avatar of Phanx Phanx May 02, 2014 at 07:43 UTC - 0 likes

    Yep, I just installed this and got the same error. The problem is that the player's GUID isn't always (or ever?) available yet when the main chunk executes during a fresh login (though it is after a /reload). It's not guaranteed to be available until PLAYER_LOGIN fires, so you should hold off on populating your player_guid variable until then.

  • 2 comments

Facts

Reported
Mar 02, 2014
Status
New - Issue has not had initial review yet.
Type
Other - Some other kind of issue
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees