From 882a058a51d38cd1bc74215d970f8177c6f27c48 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Sun, 21 Aug 2016 17:27:19 +0300 Subject: [PATCH] Added more safechecks. this fixes #292 --- ElvUI_SLE/modules/sledatatexts/guild.lua | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ElvUI_SLE/modules/sledatatexts/guild.lua b/ElvUI_SLE/modules/sledatatexts/guild.lua index d84438b..adaac80 100644 --- a/ElvUI_SLE/modules/sledatatexts/guild.lua +++ b/ElvUI_SLE/modules/sledatatexts/guild.lua @@ -48,10 +48,13 @@ ssRegFont:SetFont(GameTooltipText:GetFont(), 12) local list_sort = { TOONNAME = function(a, b) + if not a["TOONNAME"] or not b["TOONNAME"] then return false end return a["TOONNAME"] < b["TOONNAME"] end, LEVEL = function(a, b) - if a["LEVEL"] < b["LEVEL"] then + if not a["LEVEL"] or not b["LEVEL"] then + return false + elseif a["LEVEL"] < b["LEVEL"] then return true elseif a["LEVEL"] > b["LEVEL"] then return false @@ -60,7 +63,9 @@ local list_sort = { end end, RANKINDEX = function(a, b) - if a["RANKINDEX"] > b["RANKINDEX"] then + if not a["RANKINDEX"] or not b["RANKINDEX"] then + return false + elseif a["RANKINDEX"] > b["RANKINDEX"] then return true elseif a["RANKINDEX"] < b["RANKINDEX"] then return false @@ -80,10 +85,13 @@ local list_sort = { end end, revTOONNAME = function(a, b) + if a["TOONNAME"] or not b["TOONNAME"] then return false end return a["TOONNAME"] > b["TOONNAME"] end, revLEVEL = function(a, b) - if a["LEVEL"] > b["LEVEL"] then + if not a["LEVEL"] or not b["LEVEL"] then + return false + elseif a["LEVEL"] > b["LEVEL"] then return true elseif a["LEVEL"] < b["LEVEL"] then return false @@ -92,7 +100,9 @@ local list_sort = { end end, revRANKINDEX = function(a, b) - if a["RANKINDEX"] < b["RANKINDEX"] then + if not a["RANKINDEX"] or not b["RANKINDEX"] then + return false + elseif a["RANKINDEX"] < b["RANKINDEX"] then return true elseif a["RANKINDEX"] > b["RANKINDEX"] then return false @@ -101,7 +111,9 @@ local list_sort = { end end, revZONENAME = function(a, b) - if a["ZONENAME"] > b["ZONENAME"] then + if not a["ZONENAME"] or not b["ZONENAME"] then + return false + elseif a["ZONENAME"] > b["ZONENAME"] then return true elseif a["ZONENAME"] < b["ZONENAME"] then return false -- 1.7.9.5