requireValue

fun <T : R?, R : Any> LiveData<T>.requireValue(): R

Gets the value stored in the LiveData object that should not be null.

Throws

if the value is null.