diff --git a/ArchiSteamFarm/OS.cs b/ArchiSteamFarm/OS.cs index 802167b6e..d318e1334 100644 --- a/ArchiSteamFarm/OS.cs +++ b/ArchiSteamFarm/OS.cs @@ -138,7 +138,7 @@ namespace ArchiSteamFarm { } internal static void UnixSetFileAccess(string path, EUnixPermission permission) { - if (string.IsNullOrEmpty(path) || !File.Exists(path)) { + if (string.IsNullOrEmpty(path)) { ASF.ArchiLogger.LogNullError(nameof(path)); return; @@ -148,6 +148,12 @@ namespace ArchiSteamFarm { return; } + if (!File.Exists(path) && !Directory.Exists(path)) { + ASF.ArchiLogger.LogGenericError(string.Format(Strings.WarningFailedWithError, "!" + nameof(path))); + + return; + } + // Chmod() returns 0 on success, -1 on failure if (NativeMethods.Chmod(path, (int) permission) != 0) { ASF.ArchiLogger.LogGenericError(string.Format(Strings.WarningFailedWithError, Marshal.GetLastWin32Error()));