Skip to content

Commit 424f3e5

Browse files
committed
fix(login): add error handling for world switching failure
1 parent 6de7ce0 commit 424f3e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

osrs/interfaces/login/login.simba

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,10 @@ begin
605605
end;
606606

607607
if (profile.Worlds.Length > 0) and not profile.Worlds.Contains(LoginWorldSwitcher.GetCurrent()) then
608-
LoginWorldSwitcher.Switch(profile.Worlds.Random());
608+
begin
609+
if not LoginWorldSwitcher.Switch(profile.Worlds.Random()) then
610+
raise GetDebugLn('Login', 'Failed to switch to a valid world from the profile list.');
611+
end;
609612

610613
if not Self.HandleMessage(Self.GetMessage(), profile.Username, profile.Password) then Exit;
611614
Sleep(600, 1200);

0 commit comments

Comments
 (0)