mirror of
https://github.com/minetest/minetest.git
synced 2024-12-22 22:22:23 +01:00
Fix mainmenu crash if no servers match search
fixes a regression caused by 6c324cb
This commit is contained in:
parent
b857798848
commit
ae96a8d4fa
@ -57,6 +57,11 @@ end
|
||||
|
||||
-- Persists the selected server in the "address" and "remote_port" settings
|
||||
local function set_selected_server(server)
|
||||
if server == nil then -- reset selection
|
||||
core.settings:remove("address")
|
||||
core.settings:remove("remote_port")
|
||||
return
|
||||
end
|
||||
local address = server.address
|
||||
local port = server.port
|
||||
gamedata.serverdescription = server.description
|
||||
@ -360,6 +365,7 @@ local function main_button_handler(tabview, fields, name, tabdata)
|
||||
tabdata.search_for = fields.te_search
|
||||
search_server_list(fields.te_search:lower())
|
||||
if menudata.search_result then
|
||||
-- Note: This clears the selection if there are no results
|
||||
set_selected_server(menudata.search_result[1])
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user