Skip to content

Commit

Permalink
Resolve potential issue with null address or payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustify committed Apr 7, 2024
1 parent 498425a commit 834c113
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SdrsDecoder.Plugin/PocsagControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,13 @@ private void MessageReceived(MessageBase message)
foreach (var filterElement in filterElements)
{
if (message.Address.Contains(filterElement, StringComparison.InvariantCultureIgnoreCase) || message.Payload.Contains(filterElement, StringComparison.InvariantCultureIgnoreCase))
if (!string.IsNullOrWhiteSpace(message.Address) && message.Address.Contains(filterElement, StringComparison.InvariantCultureIgnoreCase))
{
filterMatched = true;
break;
}
if (!string.IsNullOrWhiteSpace(message.Payload) && message.Payload.Contains(filterElement, StringComparison.InvariantCultureIgnoreCase))
{
filterMatched = true;
break;
Expand Down Expand Up @@ -250,7 +256,6 @@ private void MessageReceived(MessageBase message)
this.dataGridView1.FirstDisplayedScrollingRowIndex = firstDisplayed + 1;
}
}
if (this.Settings.Logging)
{
Expand Down

0 comments on commit 834c113

Please sign in to comment.