Skip to content

Commit

Permalink
Delete existing battery report to avoid an error when getting battery…
Browse files Browse the repository at this point in the history
… information
  • Loading branch information
JimmahDean committed Mar 2, 2024
1 parent 23e2172 commit 0d25f5b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/data/Methods/Hardware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 0d25f5b

Please sign in to comment.