epgp (dkp reloaded)

3,442,949 Downloads Last Updated: Sep 16, 2017 Game Version: 7.3.0

standings variable contains nil record

#7 By  Charles082986

Created Sep 24, 2017 Updated Sep 24, 2017


In all tested guilds, the "standings" variable crashes the ComparatorWrapper by passing in a nil argument for either a or b.  See the "RefreshStandings" function.

Charles082986   added a tag
  Sep 24, 2017
Sep 24, 2017

Rewriting the wrapper to contain the following code:


local function ComparatorWrapper(f)
  return function(a, b)
			if a == nil then print(ComparatorWrapperIndex..": A = nil;B = "..b)
			elseif b == nil then print(ComparatorWrapperIndex..": A = "..a..";B = nil")
			else print(ComparatorWrapperIndex..": A = "..a..";B = "..b) end
			ComparatorWrapperIndex = ComparatorWrapperIndex + 1
			if (a == nil and b ~= nil) then return false; end
			if (b == nil and a ~= nil) then return true; end
           local a_in_raid = not not UnitInRaid(Ambiguate(a, "none"))
           local b_in_raid = not not UnitInRaid(Ambiguate(b, "none"))
           if a_in_raid ~= b_in_raid then
             return not b_in_raid

           local a_selected = selected[a]
           local b_selected = selected[b]

           if a_selected ~= b_selected then
             return not b_selected

           return f(a, b)

 Creates an invalid sort function error, though it does properly handle the nil values passed in to the comparator.


As a small test case guild, I used High Arcana on Illidan.  The guild has 9 members, one of them is flagged as my alt.  All officer notes are formatted appropriately.

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