[CSHARP-150] MongoConnection#tcpClient might be null in MongoConnection.Close() Created: 19/Jan/11  Updated: 02/Apr/15  Resolved: 19/Jan/11

Status: Closed
Project: C# Driver
Component/s: Performance
Affects Version/s: 1.0
Fix Version/s: 0.11

Type: Improvement Priority: Minor - P4
Reporter: Aristarkh Zagorodnikov Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

MongoConnection#tcpClient might be null in MongoConnection.Close() leading to a bunch of handled NullReferenceExceptions (I encountered this when trying to connect to an incomplete replica set). While this does not affect functionality, debugging (especially online) and performance suffers from extra exceptions. I believe that a simple null check would solve the problem.



 Comments   
Comment by Robert Stam [ 19/Jan/11 ]

Fixed. Check tcpClient for null before attempting to close it.

Generated at Wed Feb 07 21:35:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.