mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-18 08:15:26 +02:00
Remove not-null assertion
This commit is contained in:
parent
d0a873ea43
commit
cf59362708
@ -282,8 +282,8 @@ internal class ConverterViewModel @Inject constructor(
|
||||
val updateDate = unitsRepo.updateRates(unit) ?: throw Exception("Empty cache")
|
||||
|
||||
// Set to fresh objects with updated basic unit values
|
||||
_unitFrom.update { unitsRepo.getById(it!!.id) }
|
||||
_unitTo.update { unitsRepo.getById(it!!.id) }
|
||||
_unitFrom.update { unitFrom -> unitFrom?.id?.let { unitsRepo.getById(it) } }
|
||||
_unitTo.update { unitTo -> unitTo?.id?.let { unitsRepo.getById(it) } }
|
||||
_currenciesState.update { CurrencyRateUpdateState.Ready(updateDate) }
|
||||
} catch (e: Exception) {
|
||||
_currenciesState.update { CurrencyRateUpdateState.Error }
|
||||
|
Loading…
x
Reference in New Issue
Block a user