Skip to content

Commit 895c48b

Browse files
committed
Merge pull request #672 from Gama11/PathModelException
PathModel::ExploreFolder: fix potential FileNotFoundException
2 parents 32f200a + a42a947 commit 895c48b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

External/Plugins/ASCompletion/Model/PathModel.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -463,25 +463,25 @@ private void ExploreFolder(string path, string[] masks, List<string> explored, L
463463
if (!Directory.Exists(path)) return;
464464
explored.Add(path);
465465

466-
// convert classes
467466
try
468467
{
468+
// convert classes
469469
foreach (string mask in masks)
470470
{
471471
string[] files = Directory.GetFiles(path, mask);
472472
if (files != null)
473473
foreach (string file in files) foundFiles.Add(file);
474474
}
475-
}
476-
catch { }
477475

478-
// explore subfolders
479-
string[] dirs = Directory.GetDirectories(path);
480-
foreach (string dir in dirs)
481-
{
482-
if (!explored.Contains(dir) && (File.GetAttributes(dir) & FileAttributes.Hidden) == 0)
483-
ExploreFolder(dir, masks, explored, foundFiles);
476+
// explore subfolders
477+
string[] dirs = Directory.GetDirectories(path);
478+
foreach (string dir in dirs)
479+
{
480+
if (!explored.Contains(dir) && (File.GetAttributes(dir) & FileAttributes.Hidden) == 0)
481+
ExploreFolder(dir, masks, explored, foundFiles);
482+
}
484483
}
484+
catch { }
485485
}
486486
#endregion
487487

0 commit comments

Comments
 (0)