File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
src/PowerShellEditorServices/Session Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -123,15 +123,17 @@ private void RecursivelyFindReferences(
123123 scriptFile . FilePath ,
124124 referencedFileName ) ;
125125
126- // Get the referenced file if it's not already in referencedScriptFiles
127- referencedFile = this . GetFile ( resolvedScriptPath ) ;
128- if ( ! referencedScriptFiles . ContainsKey ( resolvedScriptPath ) )
126+ // make sure file exists before trying to get the file
127+ if ( File . Exists ( resolvedScriptPath ) )
129128 {
130- referencedScriptFiles . Add ( resolvedScriptPath , referencedFile ) ;
131- RecursivelyFindReferences ( referencedFile , referencedScriptFiles ) ;
129+ // Get the referenced file if it's not already in referencedScriptFiles
130+ referencedFile = this . GetFile ( resolvedScriptPath ) ;
131+ if ( ! referencedScriptFiles . ContainsKey ( resolvedScriptPath ) )
132+ {
133+ referencedScriptFiles . Add ( resolvedScriptPath , referencedFile ) ;
134+ RecursivelyFindReferences ( referencedFile , referencedScriptFiles ) ;
135+ }
132136 }
133-
134-
135137 }
136138 }
137139
You can’t perform that action at this time.
0 commit comments