Skip to content

Commit

Permalink
Fixed NRE when packet parser returns null #17
Browse files Browse the repository at this point in the history
  • Loading branch information
jaburns committed May 24, 2014
1 parent 699b311 commit 9f42f2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Readers/SerialControllerReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ void serialMonitor_Disconnected(object sender, EventArgs e)
void serialMonitor_PacketReceived (object sender, byte[] packet)
{
if (ControllerStateChanged != null) {
ControllerStateChanged (this, _packetParser (packet));
var state = _packetParser (packet);
if (state != null) {
ControllerStateChanged (this, state);
}
}
}

Expand Down

0 comments on commit 9f42f2f

Please sign in to comment.