update duration requirement

This commit is contained in:
Milos Kozak 2021-05-28 08:59:52 +02:00
parent 763c0bb766
commit 82cce81d0b
2 changed files with 2 additions and 2 deletions

View file

@ -45,8 +45,7 @@ data class TemporaryBasal(
) : TraceableDBEntry, DBEntryWithTimeAndDuration {
init {
if (duration <= 0)
require(duration > 0)
require(duration > 0)
}
enum class Type {

View file

@ -8,6 +8,7 @@ var DBEntryWithTimeAndDuration.end
get() = timestamp + duration
set(value) {
duration = value - timestamp
require(duration > 0)
}
@JvmOverloads