mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-18 16:25:27 +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")
|
val updateDate = unitsRepo.updateRates(unit) ?: throw Exception("Empty cache")
|
||||||
|
|
||||||
// Set to fresh objects with updated basic unit values
|
// Set to fresh objects with updated basic unit values
|
||||||
_unitFrom.update { unitsRepo.getById(it!!.id) }
|
_unitFrom.update { unitFrom -> unitFrom?.id?.let { unitsRepo.getById(it) } }
|
||||||
_unitTo.update { unitsRepo.getById(it!!.id) }
|
_unitTo.update { unitTo -> unitTo?.id?.let { unitsRepo.getById(it) } }
|
||||||
_currenciesState.update { CurrencyRateUpdateState.Ready(updateDate) }
|
_currenciesState.update { CurrencyRateUpdateState.Ready(updateDate) }
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
_currenciesState.update { CurrencyRateUpdateState.Error }
|
_currenciesState.update { CurrencyRateUpdateState.Error }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user