I usually resolve this situation with the operator ?::
if (subsriber?.isUnsubscribed ?: false && isDataEmpty()) {
loadData()
}
Thus, if subscriberthe same null, subsriber?.isUnsubscribedalso null, and subsriber?.isUnsubscribed ?: falseis estimated as falsethat, we hope, will be expected results, otherwise switch on ?: true.
, as Boolean , null.