Skip to content

Commit 2a0fd60

Browse files
authored
CSHARP-5252: Fix possible null reference (#1433)
1 parent d36568a commit 2a0fd60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MongoDB.Driver/Core/Clusters/DnsMonitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private TimeSpan ComputeRescanDelay(List<SrvRecord> srvRecords)
115115
{
116116
var delay = TimeSpan.FromSeconds(60);
117117

118-
if (srvRecords.Count > 0)
118+
if (srvRecords?.Count > 0)
119119
{
120120
var minTimeToLive = srvRecords.Select(s => s.TimeToLive).Min();
121121
if (minTimeToLive > delay)

0 commit comments

Comments
 (0)