Merge pull request #665 from rdziadosz/dev

NullPointerException while processing Bolus entries
This commit is contained in:
Milos Kozak 2021-09-08 13:53:41 +02:00 committed by GitHub
commit ddbeb31d49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -473,7 +473,7 @@ class MedtronicHistoryData @Inject constructor(
for (bolus in entryList) {
val bolusDTO = bolus.decodedData["Object"] as BolusDTO
var type: DetailedBolusInfo.BolusType = DetailedBolusInfo.BolusType.NORMAL
var type: DetailedBolusInfo.BolusType? = DetailedBolusInfo.BolusType.NORMAL
var multiwave = false
if (bolusDTO.bolusType == PumpBolusType.Extended) {
@ -500,7 +500,7 @@ class MedtronicHistoryData @Inject constructor(
temporaryId = entryWithTempId.temporaryId
pumpSyncStorage.removeBolusWithTemporaryId(temporaryId)
boluses.remove(entryWithTempId)
type = entryWithTempId.bolusData!!.bolusType
type = entryWithTempId.bolusData?.bolusType
}
}