Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed 'Add Folder Access To Path Bug'

Added an try .. empty catch around the code which requests the files. I'm not sure if we should display an error message if this exception occurs.
  • Loading branch information...
commit 0b45b5d79aff4d1fd66b3b845dec75fcdeba781d 1 parent 8b32c02
@marklagendijk authored
Showing with 15 additions and 11 deletions.
  1. +15 −11 WinLess/Models/Directory.cs
View
26 WinLess/Models/Directory.cs
@@ -97,22 +97,26 @@ public override string ToString()
private void AddFiles(DirectoryInfo directoryInfo)
{
- FileInfo[] files = directoryInfo.GetFiles();
- foreach (FileInfo file in files)
+ try
{
- if ((string.Compare(file.Extension, ".less", StringComparison.InvariantCultureIgnoreCase) == 0 ||
- (string.Compare(file.Extension, ".css", StringComparison.InvariantCultureIgnoreCase) == 0) && file.Name.Contains(".less")
- ) && !this.ContainsFile(file.FullName))
+ FileInfo[] files = directoryInfo.GetFiles();
+ foreach (FileInfo file in files)
{
- Files.Add(new Models.File(this, file.FullName));
+ if ((string.Compare(file.Extension, ".less", StringComparison.InvariantCultureIgnoreCase) == 0 ||
+ (string.Compare(file.Extension, ".css", StringComparison.InvariantCultureIgnoreCase) == 0) && file.Name.Contains(".less")
+ ) && !this.ContainsFile(file.FullName))
+ {
+ Files.Add(new Models.File(this, file.FullName));
+ }
}
- }
- DirectoryInfo[] subDirectories = directoryInfo.GetDirectories();
- foreach (DirectoryInfo subDirectoryInfo in subDirectories)
- {
- AddFiles(subDirectoryInfo);
+ DirectoryInfo[] subDirectories = directoryInfo.GetDirectories();
+ foreach (DirectoryInfo subDirectoryInfo in subDirectories)
+ {
+ AddFiles(subDirectoryInfo);
+ }
}
+ catch{}
}
#endregion
Please sign in to comment.
Something went wrong with that request. Please try again.