Permalink
Browse files

Better null checks.

  • Loading branch information...
1 parent 30cda5d commit 41ee6845f0fa10bb7941ada402a4067aaf57f329 polyethene committed Dec 3, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 Bot.cs
View
6 Bot.cs
@@ -50,11 +50,11 @@ public void Start()
Client.Pong(msg[1]);
else if (msg[1] == Client.PRIVMSG)
{
- Message message;
+ Message message = null;
try { message = new Message(line); }
- catch (ArgumentOutOfRangeException) { continue; }
+ catch (ArgumentOutOfRangeException) { }
- if (MessageReceived != null)
+ if (MessageReceived != null && message != null)
MessageReceived(this, new MessageReceivedArgs(Client, message));
if (Quit)

0 comments on commit 41ee684

Please sign in to comment.