Permalink
Browse files

Fix NullReferenceException when accessing Connection.EndPoint without…

… being connected.
  • Loading branch information...
lanwin committed Jun 29, 2010
1 parent 4a0c044 commit 3494a3bef38984bbf6268e11c1fa935065c1fe56
Showing with 1 addition and 1 deletion.
  1. +1 −1 source/MongoDB/Connections/Connection.cs
@@ -58,7 +58,7 @@ public Connection(IConnectionFactory factory)
/// </summary>
/// <value>The end point.</value>
public MongoServerEndPoint EndPoint{
- get { return _connection.EndPoint; }
+ get { return _connection == null ? null : _connection.EndPoint; }
}
/// <summary>

0 comments on commit 3494a3b

Please sign in to comment.