From 4ef88ff9d44f793bb22bdc6b453ebb114afd278f Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Tue, 26 Jul 2016 01:15:54 +0100 Subject: [PATCH] FIX: GetAutoCompleteRealms() returning nothing Added a catch for GetAutoCompleteRealms() returning an empty result which caused the addon to fail with the following error: BagSync\BagSync-v8.7.lua:1128: bad argument #1 to 'pairs' (table expected, got no value) [C]: in function `pairs' BagSync\BagSync-v8.7.lua:1128: in function `?' BagSync\BagSync-v8.7.lua:94: in function Locals: (*temporary) = "table expected, got no value" = defined =[C]:-1 --- BagSync.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BagSync.lua b/BagSync.lua index cca754d..96a125f 100644 --- a/BagSync.lua +++ b/BagSync.lua @@ -1125,7 +1125,9 @@ function BagSync:PLAYER_LOGIN() playerClass = select(2, UnitClass("player")) playerFaction = UnitFactionGroup("player") - for k, v in pairs(GetAutoCompleteRealms()) do + local autoCompleteRealms = GetAutoCompleteRealms() or { currentRealm } + + for k, v in pairs(autoCompleteRealms) do if v ~= currentRealm then crossRealmNames[v] = true end -- 1.7.9.5