File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Python/Product/PythonTools/PythonTools/LanguageServerClient Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -377,8 +377,12 @@ private LanguageServerSettings.PythonSettings GetSettings(Uri scopeUri = null) {
377377 context = _clientContexts . Find ( c => c . RootPath == null ) ;
378378 if ( context == null ) {
379379 // use first clientcontext as default
380- context = _clientContexts . First ( ) ;
381- }
380+ try {
381+ context = _clientContexts . First ( ) ;
382+ } catch ( InvalidOperationException ) {
383+ // no client context
384+ return null ;
385+ }
382386 } else {
383387 var pathFromScopeUri = CommonUtils . NormalizeDirectoryPath ( scopeUri . LocalPath ) . ToLower ( ) . TrimStart ( '\\ ' ) ;
384388 // Find the matching context for the item, but ignore interactive window where "RootPath" is null.
You can’t perform that action at this time.
0 commit comments