update duration requirement
This commit is contained in:
parent
763c0bb766
commit
82cce81d0b
|
@ -45,8 +45,7 @@ data class TemporaryBasal(
|
|||
) : TraceableDBEntry, DBEntryWithTimeAndDuration {
|
||||
|
||||
init {
|
||||
if (duration <= 0)
|
||||
require(duration > 0)
|
||||
require(duration > 0)
|
||||
}
|
||||
|
||||
enum class Type {
|
||||
|
|
|
@ -8,6 +8,7 @@ var DBEntryWithTimeAndDuration.end
|
|||
get() = timestamp + duration
|
||||
set(value) {
|
||||
duration = value - timestamp
|
||||
require(duration > 0)
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
|
|
Loading…
Reference in a new issue