Fix serverlist issues from previous commit.
Was referencing a 'global' variable so a simple check will do.
This commit is contained in:
parent
07a2995285
commit
7a7f63586f
|
@ -11,9 +11,9 @@ function ServerList.init()
|
||||||
serverListWindow = g_ui.displayUI('serverlist')
|
serverListWindow = g_ui.displayUI('serverlist')
|
||||||
serverTextList = serverListWindow:getChildById('serverList')
|
serverTextList = serverListWindow:getChildById('serverList')
|
||||||
|
|
||||||
local serverSettings = g_settings.getNode('ServerList')
|
servers = g_settings.getNode('ServerList') or {}
|
||||||
if serverSettings then
|
if servers then
|
||||||
ServerList.load(serverSettings)
|
ServerList.load()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ function ServerList.terminate()
|
||||||
ServerList = nil
|
ServerList = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function ServerList.load(serverSettings)
|
function ServerList.load()
|
||||||
for host, server in pairs(serverSettings) do
|
for host, server in pairs(servers) do
|
||||||
ServerList.add(host, server.port, server.protocol, true)
|
ServerList.add(host, server.port, server.protocol, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue