From ae5b80278e16843ecc1823fc817ea7aa0c24d843 Mon Sep 17 00:00:00 2001 From: Barichello Date: Thu, 20 Jan 2022 16:58:57 -0300 Subject: Fix serverbrowser crash on empty server list --- Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Northstar.Client/mod/scripts/vscripts') diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut index b0c56b65..0f96d2e4 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -785,7 +785,8 @@ void function OnServerButtonFocused( var button ) { int scriptID = int (Hud_GetScriptID(button)) file.serverButtonFocusedID = scriptID - file.focusedServerIndex = file.serversArrayFiltered[ file.scrollOffset + scriptID ].serverIndex + if ( file.serversArrayFiltered.len() > 0 ) + file.focusedServerIndex = file.serversArrayFiltered[ file.scrollOffset + scriptID ].serverIndex DisplayFocusedServerInfo(scriptID); } -- cgit v1.2.3