Xdrip: prevent NPE
This commit is contained in:
parent
75d34955b7
commit
8ce12d61c0
1 changed files with 2 additions and 4 deletions
|
@ -362,10 +362,8 @@ class XdripPlugin @Inject constructor(
|
|||
|
||||
private fun sendEntries(dataPairs: List<DataSyncSelector.DataPair>, progress: String) {
|
||||
val array = JSONArray()
|
||||
for (dataPair in dataPairs) {
|
||||
val data = (dataPair as DataSyncSelector.PairGlucoseValue).value.toXdripJson()
|
||||
array.put(data)
|
||||
}
|
||||
for (dataPair in dataPairs)
|
||||
(dataPair as DataSyncSelector.PairGlucoseValue?)?.value?.toXdripJson()?.also { gv -> array.put(gv) }
|
||||
rxBus.send(EventXdripNewLog("SENDING", "Sent ${array.length()} BGs ($progress)"))
|
||||
broadcast(
|
||||
Intent(Intents.ACTION_NEW_SGV)
|
||||
|
|
Loading…
Reference in a new issue