Fix serverlist issues from previous commit.

Was referencing a 'global' variable so a simple check will do.
This commit is contained in:
BenDol 2015-07-19 06:34:21 +12:00
parent 07a2995285
commit 7a7f63586f
1 changed files with 5 additions and 5 deletions

View File

@ -11,9 +11,9 @@ function ServerList.init()
serverListWindow = g_ui.displayUI('serverlist')
serverTextList = serverListWindow:getChildById('serverList')
local serverSettings = g_settings.getNode('ServerList')
if serverSettings then
ServerList.load(serverSettings)
servers = g_settings.getNode('ServerList') or {}
if servers then
ServerList.load()
end
end
@ -25,8 +25,8 @@ function ServerList.terminate()
ServerList = nil
end
function ServerList.load(serverSettings)
for host, server in pairs(serverSettings) do
function ServerList.load()
for host, server in pairs(servers) do
ServerList.add(host, server.port, server.protocol, true)
end
end