Skip to content

Commit 1d4324b

Browse files
fix(queryrealms): edge case parsing realms when zero arguments have been passed
1 parent f90c3d5 commit 1d4324b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Atlasd/Battlenet/Protocols/Game/Messages/SID_QUERYREALMS2.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ public override bool Invoke(MessageContext context)
4242
}
4343
case MessageDirection.ServerToClient:
4444
{
45-
Dictionary<byte[], byte[]> realms = context.Arguments.ContainsKey("realms") ? (Dictionary<byte[], byte[]>)context.Arguments["realms"] : new Dictionary<byte[], byte[]>();
45+
Logging.WriteLine(Logging.LogLevel.Debug, Logging.LogType.Client_Game, context.Client.RemoteEndPoint, "foobar");
46+
47+
Dictionary<byte[], byte[]> realms =
48+
context.Arguments == null || !context.Arguments.ContainsKey("realms") ?
49+
new Dictionary<byte[], byte[]>() :
50+
(Dictionary<byte[], byte[]>)context.Arguments["realms"];
4651

4752
/**
4853
* (UINT32) Unknown (0)

0 commit comments

Comments
 (0)