Skip to content

Commit b9cd3fc

Browse files
committed
Ensure that Battery charge may not be used as a shutdown trigger when its value is -1 (indicating its unavailable).
1 parent f7efe81 commit b9cd3fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WinNUT_V2/WinNUT-Client/WinNUT.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ Public Class WinNUT
641641
If .Batt_Charge = -1 AndAlso .Batt_Runtime = -1 Then
642642
LogFile.LogTracing("Battery properties unavailable, unable to validate shutdown conditions.", LogLvl.LOG_WARNING, Me)
643643
ElseIf Not ShutdownStatus Then
644-
If .Batt_Charge <= My.Settings.PW_BattChrgFloor Or
644+
If (.Batt_Charge <> -1 AndAlso .Batt_Charge <= My.Settings.PW_BattChrgFloor) Or
645645
(.Batt_Runtime <> -1 AndAlso .Batt_Runtime <= My.Settings.PW_RuntimeFloor) Then
646646
LogFile.LogTracing("UPS battery has dropped below stop condition limits.",
647647
LogLvl.LOG_NOTICE, Me, StrLog.Item(AppResxStr.STR_LOG_SHUT_START))

0 commit comments

Comments
 (0)