kotlin-extensions / io.realm.kotlin / io.realm.RealmModel / isValid

isValid

fun RealmModel.isValid(): Boolean

Checks if the RealmObject is still valid to use i.e., the RealmObject hasn't been deleted nor has the Realm been closed. It will always return true for unmanaged objects.

Return
true if the object is still accessible or an unmanaged object, false otherwise.