From 755bae830fdf9e144f77c03f12a83bea9f251e38 Mon Sep 17 00:00:00 2001 From: Terkoiz Date: Wed, 27 Dec 2023 23:57:37 +0200 Subject: [PATCH] Fix for ValidationUtil --- project/Aki.Core/Utils/ValidationUtil.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/project/Aki.Core/Utils/ValidationUtil.cs b/project/Aki.Core/Utils/ValidationUtil.cs index 696a1ff..75fa9e5 100644 --- a/project/Aki.Core/Utils/ValidationUtil.cs +++ b/project/Aki.Core/Utils/ValidationUtil.cs @@ -1,5 +1,4 @@ using Aki.Common.Utils; -using BepInEx.Logging; using Microsoft.Win32; using System.IO; @@ -28,9 +27,9 @@ namespace Aki.Core.Utils new FileInfo(Path.Combine(v2, "UnityCrashHandler64.exe")) }; - ServerLog.Debug("Aki.Core", new FileInfo(Path.Combine(v2, "UnityCrashHandler64.exe")).Length.ToString()); - ServerLog.Debug("Aki.Core", new FileInfo(Path.Combine(v2, "Uninstall.exe")).Length.ToString()); - ServerLog.Debug("Aki.Core", new FileInfo(Path.Combine(v2, "Register.bat")).Length.ToString()); + ServerLog.Debug("Aki.Core", Gfs(v2, "UnityCrashHandler64.exe")?.Length.ToString() ?? "0"); + ServerLog.Debug("Aki.Core", Gfs(v2, "Uninstall.exe")?.Length.ToString() ?? "0"); + ServerLog.Debug("Aki.Core", Gfs(v2, "Register.bat")?.Length.ToString() ?? "0"); v0 = v4.Length - 1; @@ -49,5 +48,11 @@ namespace Aki.Core.Utils return v0 == 0; } + + private static FileInfo Gfs(string p, string f) + { + var a = Path.Combine(p, f); + return File.Exists(a) ? new FileInfo(a) : null; + } } }