diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-03-23 08:18:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-23 08:18:16 +0300 |
commit | ed61762299551768ea1bddbb97e36417f83db921 (patch) | |
tree | e04276d9f449e902d19e83baa1960134787f67e9 /src | |
parent | 57082a666f42246d85938c9a0919da1237c7628c (diff) |
Handle null execution context in threadpool callback (#5605)
Fixes #5603
Diffstat (limited to 'src')
-rw-r--r-- | src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs b/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs index eb5debcf1..b7b2932cf 100644 --- a/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs +++ b/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs @@ -191,6 +191,12 @@ namespace System.Threading Debug.Assert(!data._completed); data._completed = true; + if (data._executionContext == null) + { + data._callback(errorCode, bytesWritten, ToNativeOverlapped(overlapped)); + return; + } + ContextCallback callback = s_executionContextCallback; if (callback == null) s_executionContextCallback = callback = OnExecutionContextCallback; |