IpnViewModel: fix NPE (#413)

Fixes tailscale/tailscale#12281

Signed-off-by: kari-ts <kari@tailscale.com>
pull/415/head
kari-ts 6 months ago committed by GitHub
parent cbc47791ad
commit 8f62f0da79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -75,8 +75,10 @@ open class IpnViewModel : ViewModel() {
viewModelScope.launch {
Notifier.prefs.collect {
it?.let { lastPrefs = it }
isRunningExitNode.set(it?.let { AdvertisedRoutesHelper.exitNodeOnFromPrefs(it) })
it?.let {
lastPrefs = it
isRunningExitNode.set(AdvertisedRoutesHelper.exitNodeOnFromPrefs(it))
}
}
}

Loading…
Cancel
Save