From 904a5ffcb4d7339efed24156409e67b58c0e77bc Mon Sep 17 00:00:00 2001 From: jcm Date: Sun, 11 Feb 2024 17:10:21 -0600 Subject: [PATCH] Handle exceptions when checking user data directory for symlink (#6304) Co-authored-by: jcm --- src/Ryujinx.Common/Configuration/AppDataManager.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.Common/Configuration/AppDataManager.cs b/src/Ryujinx.Common/Configuration/AppDataManager.cs index 26b587daa..deaa03def 100644 --- a/src/Ryujinx.Common/Configuration/AppDataManager.cs +++ b/src/Ryujinx.Common/Configuration/AppDataManager.cs @@ -233,8 +233,15 @@ namespace Ryujinx.Common.Configuration // Should be removed, when the existence of the old directory isn't checked anymore. private static bool IsPathSymlink(string path) { - FileAttributes attributes = File.GetAttributes(path); - return (attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint; + try + { + FileAttributes attributes = File.GetAttributes(path); + return (attributes & FileAttributes.ReparsePoint) == FileAttributes.ReparsePoint; + } + catch + { + return false; + } } [SupportedOSPlatform("macos")]