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(
123
123
scriptFile . FilePath ,
124
124
referencedFileName ) ;
125
125
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 ) )
129
128
{
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
+ }
132
136
}
133
-
134
-
135
137
}
136
138
}
137
139
You can’t perform that action at this time.
0 commit comments