From 0d25f5b4dd0d9e567506c60c825242562015d03f Mon Sep 17 00:00:00 2001 From: JimmahDean Date: Sat, 2 Mar 2024 12:02:13 -0700 Subject: [PATCH] Delete existing battery report to avoid an error when getting battery information --- client/data/Methods/Hardware.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/data/Methods/Hardware.cs b/client/data/Methods/Hardware.cs index 954eacf..5e17ce2 100644 --- a/client/data/Methods/Hardware.cs +++ b/client/data/Methods/Hardware.cs @@ -1281,6 +1281,11 @@ private static async Task GetBatteryData() Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly() .Location); //Directory the .exe has been launched from + if (File.Exists(Path.Combine(path, "battery-report.xml"))) + { + File.Delete(Path.Combine(path, "battery-report.xml")); + } + Process cmd = new Process //Generate the XML report we'll be grabbing the data from { StartInfo =