Prevent NullReferenceException in KestrelThread.OnStopRude

- UvMemory.FromIntPtr looks up a weak reference so we need to null check.
This commit is contained in:
Stephen Halter 2016-05-12 15:43:29 -07:00
parent 8c8ee150f7
commit 185ad000bb
1 changed files with 2 additions and 1 deletions

View File

@ -132,7 +132,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel
var handle = UvMemory.FromIntPtr<UvHandle>(ptr);
if (handle != _post)
{
handle.Dispose();
// handle can be null because UvMemory.FromIntPtr looks up a weak reference
handle?.Dispose();
}
});