Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit a10473f

Browse files
committed
Fix HttpListenerFactory Dispose after failure
If the ctor encounters a failure, _processPrefixListener may remain null; then when the factory is Dispose'd, it null refs. This is taking out a bunch of runs, including almost all macOS runs.
1 parent a4fe5cc commit a10473f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/System.Net.HttpListener/tests/HttpListenerFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static bool SupportsWildcards
131131

132132
public HttpListener GetListener() => _processPrefixListener;
133133

134-
public void Dispose() => _processPrefixListener.Close();
134+
public void Dispose() => _processPrefixListener?.Close();
135135

136136
public Socket GetConnectedSocket()
137137
{

0 commit comments

Comments
 (0)