Actually catch only UnauthorizedAccessException.

This commit is contained in:
caitsith2 2018-08-31 16:54:22 -07:00 committed by Alex Barney
parent a7079a3daf
commit b5bfb07cb7

View file

@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
namespace LibHac namespace LibHac
@ -46,7 +47,7 @@ namespace LibHac
{ {
result.AddRange(GetFileSystemEntries(Path.Combine(Root, path), searchPattern)); result.AddRange(GetFileSystemEntries(Path.Combine(Root, path), searchPattern));
} }
catch { /**/ } catch (UnauthorizedAccessException) { /* Skip this directory */ }
if (searchOption == SearchOption.TopDirectoryOnly) if (searchOption == SearchOption.TopDirectoryOnly)
return result.ToArray(); return result.ToArray();
@ -58,7 +59,7 @@ namespace LibHac
{ {
result.AddRange(GetFileSystemEntries(search, searchPattern, searchOption)); result.AddRange(GetFileSystemEntries(search, searchPattern, searchOption));
} }
catch { /**/ } catch (UnauthorizedAccessException) { /* Skip this result */ }
} }
return result.ToArray(); return result.ToArray();