Quantcast

Minor nil Fix for Multiple Realms

Xruptor [10-26-16 - 19:10]
Minor nil Fix for Multiple Realms
Filename
BagSync.lua
BagSync.toc
modules/search.lua
diff --git a/BagSync.lua b/BagSync.lua
index 858cc3e..5e5a750 100644
--- a/BagSync.lua
+++ b/BagSync.lua
@@ -1076,10 +1076,14 @@ function BSYC:AddItemToTooltip(frame, link) --workaround

 					--check to make sure we didn't already add a guild from a connected-realm
 					local trueRealmList = self.db.realmkey[0][v.realm] --get the connected realms
-					table.sort(trueRealmList, function(a,b) return (a < b) end) --sort them alphabetically
-					trueRealmList = table.concat(trueRealmList, "|") --concat them together
+					if trueRealmList then
+						table.sort(trueRealmList, function(a,b) return (a < b) end) --sort them alphabetically
+						trueRealmList = table.concat(trueRealmList, "|") --concat them together
+					else
+						trueRealmList = v.realm
+					end
 					trueRealmList = guildN.."-"..trueRealmList --add the guild name in front of concat realm list
-
+
 					if not previousGuilds[gName] and not previousGuildsXRList[trueRealmList] then
 						--we only really need to see this information once per guild
 						local tmpCount = 0
diff --git a/BagSync.toc b/BagSync.toc
index a99b858..05fd243 100644
--- a/BagSync.toc
+++ b/BagSync.toc
@@ -2,7 +2,7 @@
 ## Title: BagSync
 ## Notes: BagSync tracks your characters items and displays it within tooltips.
 ## Author: Xruptor
-## Version: 10.6
+## Version: 10.7
 ## OptionalDeps: tekDebug
 ## SavedVariables: BagSyncDB, BagSyncOpt, BagSyncGUILD_DB, BagSyncCURRENCY_DB, BagSyncPROFESSION_DB, BagSyncBLACKLIST_DB, BagSync_REALMKEY

diff --git a/modules/search.lua b/modules/search.lua
index 4d5294d..66b134c 100644
--- a/modules/search.lua
+++ b/modules/search.lua
@@ -212,8 +212,12 @@ function Search:DoSearch(searchStr)

 						--check to make sure we didn't already add a guild from a connected-realm
 						local trueRealmList = BSYC.db.realmkey[0][v.realm] --get the connected realms
-						table.sort(trueRealmList, function(a,b) return (a < b) end) --sort them alphabetically
-						trueRealmList = table.concat(trueRealmList, "|") --concat them together
+						if trueRealmList then
+							table.sort(trueRealmList, function(a,b) return (a < b) end) --sort them alphabetically
+							trueRealmList = table.concat(trueRealmList, "|") --concat them together
+						else
+							trueRealmList = v.realm
+						end
 						trueRealmList = guildN.."-"..trueRealmList --add the guild name in front of concat realm list

 						if not previousGuilds[gName] and not previousGuildsXRList[trueRealmList] then