Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 9e38fb1

Browse files
authored
Merge pull request #9093 from mono/ide-startup-handle-unauthorized-access-to-file
[Ide] Handle unauthorized access exception on startup
2 parents d4a8ca6 + 7f85dda commit 9e38fb1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,14 @@ int Run (MonoDevelopOptions options)
199199

200200
if (!options.NewWindow && startupInfo.HasFiles) {
201201
foreach (var file in startupInfo.RequestedFileList) {
202-
if (MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile (file.FileName)) {
203-
options.NewWindow = true;
204-
break;
202+
try {
203+
if (MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile (file.FileName)) {
204+
options.NewWindow = true;
205+
break;
206+
}
207+
} catch (UnauthorizedAccessException ex) {
208+
LoggingService.LogError (string.Format ("Unable to check startup file is a workspace item '{0}'", file.FileName), ex);
209+
return 1;
205210
}
206211
}
207212
}

0 commit comments

Comments
 (0)