Closed sunkup closed 9 months ago
I think this only happens when the link is valid, but there's an error when adding it. Maybe during the synchronization?
I think the issue comes from the errorMessage
definition:
val errorMessage = MutableLiveData<String>()
We are not making it nullable, so Kotlin thinks that it's always unset or not null. But then, we set the value to Exception.localizedMessage
, which can be null sometimes: errorMessage.postValue(e.localizedMessage)
.
I'd make errorMessage
nullable, as well as extending the value post to this, to give more info just in case:
val errorMessage = MutableLiveData<String?>(null)
...
errorMessage.postValue(e.localizedMessage ?: e.message)
Steps to reproduce:
Stacktrace: