Skip to content

Commit

Permalink
Div by zero fix
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Jul 25, 2023
1 parent 64e6216 commit c9fc3e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/HardwareControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static decimal GetBatteryHealth()
}
ReadFullChargeCapacity();

if (designCapacity is null || fullCapacity is null)
if (designCapacity is null || fullCapacity is null || designCapacity == 0 || fullCapacity == 0)
{
return -1;
}
Expand Down

0 comments on commit c9fc3e7

Please sign in to comment.