Skip to content

Commit e6186b1

Browse files
committed
OB1: fix calibration state getter
1 parent e7ac9fa commit e6186b1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

app/src/main/java/com/eveningoutpost/dexdrip/services/Ob1G5CollectionService.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,16 +2068,20 @@ public static boolean isPendingCalibration() {
20682068

20692069
public static boolean isG5WantingInitialCalibration() {
20702070
loadCalibrationStateAsRequired();
2071-
return lastSensorStatus != null
2071+
return lastSensorState != null
20722072
&& lastSensorState == CalibrationState.NeedsFirstCalibration
20732073
&& usingNativeMode();
20742074
}
20752075

20762076
public static boolean isG5WantingCalibration() {
20772077
loadCalibrationStateAsRequired();
2078-
return lastSensorStatus != null
2079-
&& lastSensorState.needsCalibration()
2080-
&& usingNativeMode();
2078+
try {
2079+
return lastSensorState != null
2080+
&& lastSensorState.needsCalibration()
2081+
&& usingNativeMode();
2082+
} catch (NullPointerException e) {
2083+
return false;
2084+
}
20812085
}
20822086

20832087
// are we using the G5 Transmitter to evaluate readings

0 commit comments

Comments
 (0)