DynISF: prevent crash

This commit is contained in:
Milos Kozak 2022-10-25 19:55:29 +02:00
parent 52feef2efe
commit 3a123f2cba

View file

@ -306,7 +306,7 @@ class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scri
this.profile.put("TDD", tdd)
if (sp.getBoolean(R.string.key_adjust_sensitivity, false) && tdd7D != null)
if (sp.getBoolean(R.string.key_adjust_sensitivity, false) && tdd7D != null && tdd7D != 0.0)
autosensData.put("ratio", tddLast24H / tdd7D)
else
autosensData.put("ratio", 1.0)