32 - Obscure Error Fixes

I have a few fixes to some obscure errors that I've seen crop up when using Guild Check.

1) Guild Check crashes when left clicking on the minimap button.

This is due to the GUI not being created yet.  2 things needed to fix this.  First, add this before showing the GUI when left clicking the minimap:

if not self.gui then

Second, add this at the start of the function GuildCheck:CreateGui so that it doesn't attempt to create it twice:

if self.gui then return end

2) When scanning a guild, LibStub sometimes evaluates to a string when checking a player's rank.

This is just about the oddest LUA error I've seen yet.  Two things I used to fix this.  First, check to see if LibStub is a string before even starting the function:

if type(LibStub) == "string" then
   self:Debug("LibStub: " .. type(LibStub))
   self:Debug("Delay: " .. self:GetDelay())
   self:ScheduleTimer("ShowChanges", tonumber(self:GetDelay()))
   self.scanning = false

Second, after this, cache LibStub(LG) and use the cached value instead of LibStub(LG):

local LibG = LibStub(LG)

Then find LibStub(LG) and replace with LibG in the GuildCheck:ScanGuild function.

The full source code, based on 2.3.9 with the line 623 fix mentioned in a previous bug, is available at

Thanks for the addon. :)

User When Change
Jaxomuk Jan 12, 2014 at 15:44 UTC Changed status from New to Duplicate
roncli Oct 19, 2012 at 00:58 UTC Create

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


Last updated
Jan 12, 2014
Oct 19, 2012
Duplicate - This report duplicates an existing ticket.
Enhancement - A change which is intended to better the project in some way
Medium - Normal priority.

Reported by

Possible assignees