Skip to content

Commit

Permalink
Heh, Debug.Assert gets removed in release builds...
Browse files Browse the repository at this point in the history
  • Loading branch information
NZSmartie committed Dec 19, 2017
1 parent 570a29e commit fab984b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CoAPNet/CoapClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ public virtual async Task<CoapMessageIdentifier> SendAsync(CoapMessage message,
return messageId;
}

Debug.Assert(_messageResponses.TryGetValue(messageId, out var responseTaskSource), "Race condition?");
if (!_messageResponses.TryGetValue(messageId, out var responseTaskSource))
throw new CoapClientException("Race condition? This shouldn't happen. Congratuations!");

for (var attempt = 1; attempt <= MaxRetransmitAttempts; attempt++)
{
Expand Down

0 comments on commit fab984b

Please sign in to comment.