Fix crash on invalid path selection

This commit is contained in:
sapier 2014-01-22 23:13:41 +01:00
parent 2cc733bb7c
commit 4515016da8

View File

@ -516,7 +516,8 @@ function mobf_path.show_manage_menu(playername,data)
local all_paths = mobf_path.get_pathlist(playername,isadmin) local all_paths = mobf_path.get_pathlist(playername,isadmin)
mobf_print("data: " .. dump(data)) mobf_print("data: " .. dump(data))
if data.selected_path ~= nil then if data.selected_path ~= nil and
all_paths[data.selected_path] ~= nil then
data.pathname = all_paths[data.selected_path].pathname data.pathname = all_paths[data.selected_path].pathname
data.ownername = all_paths[data.selected_path].ownername data.ownername = all_paths[data.selected_path].ownername
end end