File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,8 @@ private static ConsoleKeyInfo ReadKey()
150
150
handleId = WaitHandle . WaitAny ( _singleton . _requestKeyWaitHandles , 300 ) ;
151
151
if ( handleId != WaitHandle . WaitTimeout )
152
152
break ;
153
+ if ( _singleton . _engineIntrinsics == null )
154
+ continue ;
153
155
154
156
// If we timed out, check for event subscribers (which is just
155
157
// a hint that there might be an event waiting to be processed.)
@@ -581,10 +583,13 @@ private void DelayedOneTimeInitialize()
581
583
// specifies a custom history save file, we don't want to try reading
582
584
// from the default one.
583
585
584
- var historyCountVar = _engineIntrinsics . SessionState . PSVariable . Get ( "MaximumHistoryCount" ) ;
585
- if ( historyCountVar != null && historyCountVar . Value is int )
586
+ if ( _engineIntrinsics != null )
586
587
{
587
- _options . MaximumHistoryCount = ( int ) historyCountVar . Value ;
588
+ var historyCountVar = _engineIntrinsics . SessionState . PSVariable . Get ( "MaximumHistoryCount" ) ;
589
+ if ( historyCountVar != null && historyCountVar . Value is int )
590
+ {
591
+ _options . MaximumHistoryCount = ( int ) historyCountVar . Value ;
592
+ }
588
593
}
589
594
590
595
_historyFileMutex = new Mutex ( false , GetHistorySaveFileMutexName ( ) ) ;
You can’t perform that action at this time.
0 commit comments