Skip to content

Commit a9fcc8d

Browse files
authored
Merge pull request #196 from RegorForgotTheirPassword/master
Fix of ProcessMessage throwing NullPointerExceptions
2 parents 5548f5b + 635f4f4 commit a9fcc8d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

DiscordRPC/DiscordRpcClient.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,13 @@ private void ProcessMessage(IMessage message)
300300
if (pm != null)
301301
{
302302
//We need to merge these presences together
303-
if (CurrentPresence == null)
304-
{
305-
CurrentPresence = (new RichPresence()).Merge(pm.Presence);
306-
}
307-
else if (pm.Presence == null)
303+
if (pm.Presence == null)
308304
{
309305
CurrentPresence = null;
310-
}
311-
else
306+
} else if (CurrentPresence == null)
307+
{
308+
CurrentPresence = (new RichPresence()).Merge(pm.Presence);
309+
} else
312310
{
313311
CurrentPresence.Merge(pm.Presence);
314312
}

0 commit comments

Comments
 (0)