File tree 1 file changed +2
-6
lines changed
src/PowerShellEditorServices/Workspace
1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,6 @@ private void RecursivelyFindReferences(
408
408
GetBaseFilePath (
409
409
scriptFile . FilePath ) ;
410
410
411
- ScriptFile referencedFile ;
412
411
foreach ( string referencedFileName in scriptFile . ReferencedFiles )
413
412
{
414
413
string resolvedScriptPath =
@@ -429,12 +428,9 @@ private void RecursivelyFindReferences(
429
428
referencedFileName ,
430
429
resolvedScriptPath ) ) ;
431
430
432
- // Make sure file exists before trying to get the file
433
- if ( File . Exists ( resolvedScriptPath ) )
431
+ // Get the referenced file if it's not already in referencedScriptFiles
432
+ if ( this . TryGetFile ( resolvedScriptPath , out ScriptFile referencedFile ) )
434
433
{
435
- // Get the referenced file if it's not already in referencedScriptFiles
436
- referencedFile = this . GetFile ( resolvedScriptPath ) ;
437
-
438
434
// Normalize the resolved script path and add it to the
439
435
// referenced files list if it isn't there already
440
436
resolvedScriptPath = resolvedScriptPath . ToLower ( ) ;
You can’t perform that action at this time.
0 commit comments