Prevent NullReferenceException in KestrelThread.OnStopRude
- UvMemory.FromIntPtr looks up a weak reference so we need to null check.
This commit is contained in:
parent
8c8ee150f7
commit
185ad000bb
|
|
@ -132,7 +132,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel
|
||||||
var handle = UvMemory.FromIntPtr<UvHandle>(ptr);
|
var handle = UvMemory.FromIntPtr<UvHandle>(ptr);
|
||||||
if (handle != _post)
|
if (handle != _post)
|
||||||
{
|
{
|
||||||
handle.Dispose();
|
// handle can be null because UvMemory.FromIntPtr looks up a weak reference
|
||||||
|
handle?.Dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue