Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 4bb6300

Browse files
committed
Fix #71
1 parent e1e5a8b commit 4bb6300

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

UI/MainWindowObjectBrowser.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ private void ChangeObjectBrowserToDirectory(string dir)
149149
{
150150
dir = Environment.CurrentDirectory;
151151
}
152+
try
153+
{
154+
Directory.GetAccessControl(dir);
155+
}
156+
catch (UnauthorizedAccessException)
157+
{
158+
return;
159+
}
152160
CurrentObjectBrowserDirectory = dir;
153161
Program.OptionsObject.Program_ObjectBrowserDirectory = CurrentObjectBrowserDirectory;
154162

@@ -210,6 +218,14 @@ private List<TreeViewItem> BuildDirectoryItems(string dir)
210218
{
211219
continue;
212220
}
221+
try
222+
{
223+
dInfo.GetAccessControl();
224+
}
225+
catch (UnauthorizedAccessException)
226+
{
227+
continue;
228+
}
213229
var tvi = new TreeViewItem()
214230
{
215231
Header = BuildTreeViewItemContent(dInfo.Name, "iconmonstr-folder-13-16.png"),

0 commit comments

Comments
 (0)