Fix a spurious NRE in GlobalChat

This commit is contained in:
Oliver Brakmann
2016-05-08 12:32:34 +02:00
parent bd7e53bec4
commit d049413c26

View File

@@ -241,7 +241,7 @@ namespace OpenRA.Chat
void OnJoin(object sender, JoinEventArgs e) void OnJoin(object sender, JoinEventArgs e)
{ {
if (e.Who == client.Nickname || e.Channel != channel.Name) if (e.Who == client.Nickname || channel == null || e.Channel != channel.Name)
return; return;
AddNotification("{0} joined the chat.".F(e.Who)); AddNotification("{0} joined the chat.".F(e.Who));
@@ -284,7 +284,7 @@ namespace OpenRA.Chat
void OnPart(object sender, PartEventArgs e) void OnPart(object sender, PartEventArgs e)
{ {
if (e.Data.Channel != channel.Name) if (channel == null || e.Data.Channel != channel.Name)
return; return;
AddNotification("{0} left the chat.".F(e.Who)); AddNotification("{0} left the chat.".F(e.Who));