Fix for a nullref thrown when PSES calls ForcePSEventHandling - #1097
Conversation
|
There are some greater questions that can be asked on the overall design of this contract, but this at least mitigates the issue for now. |
|
Would changing |
|
Thought about that but we want that |
daxian-dbw
left a comment
There was a problem hiding this comment.
I'm fine with this change.
|
I consulted heavily with @SeeminglyScience on this - who originally did the ground work. I'd like to give him a chance to sign off so hold off on merging until he gives a thumbs up. |
|
I don't see a problem with that, @daxian-dbw 👍 LGTM |
In PowerShell Editor Services, we have a private contract with PSRL with a method called
ForcePSEventHandlingfound in:Due to the multi-threaded nature of PSES, we are calling
ForcePSEventHandingbefore the_forceEventWaitHandlewas initialized (which happens inDelayedOneTimeInitialize() thus causing a null reference exception.This PR moves the initialization to the field declaration which fixes the issue we were seeing (PSES crashing).
This should be low risk as this is only used by PSES and they are a private contract.