소스 검색

Handle exceptions when checking user data directory for symlink (#6304)

Co-authored-by: jcm <butt@butts.com>
jcm 2 년 전
부모
커밋
904a5ffcb4
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      src/Ryujinx.Common/Configuration/AppDataManager.cs

+ 9 - 2
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")]