Use `.orEmpty()` instead of `?: ""`
This commit is contained in:
parent
5e10449746
commit
f1e57d2970
|
@ -41,7 +41,7 @@ class PushersManager @Inject constructor(
|
||||||
currentSession.pushersService().testPush(
|
currentSession.pushersService().testPush(
|
||||||
unifiedPushHelper.getPushGateway()!!,
|
unifiedPushHelper.getPushGateway()!!,
|
||||||
stringProvider.getString(R.string.pusher_app_id),
|
stringProvider.getString(R.string.pusher_app_id),
|
||||||
unifiedPushHelper.getEndpointOrToken() ?: "",
|
unifiedPushHelper.getEndpointOrToken().orEmpty(),
|
||||||
TEST_EVENT_ID
|
TEST_EVENT_ID
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,7 +191,7 @@ class UnifiedPushHelper @Inject constructor(
|
||||||
vectorPreferences?.setFdroidSyncBackgroundMode(mode)
|
vectorPreferences?.setFdroidSyncBackgroundMode(mode)
|
||||||
runBlocking {
|
runBlocking {
|
||||||
try {
|
try {
|
||||||
pushersManager?.unregisterPusher(getEndpointOrToken() ?: "")
|
pushersManager?.unregisterPusher(getEndpointOrToken().orEmpty())
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Timber.d("Probably unregistering a non existant pusher")
|
Timber.d("Probably unregistering a non existant pusher")
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,7 +192,7 @@ class VectorMessagingReceiver : MessagingReceiver() {
|
||||||
guardServiceStarter.start()
|
guardServiceStarter.start()
|
||||||
runBlocking {
|
runBlocking {
|
||||||
try {
|
try {
|
||||||
pushersManager.unregisterPusher(unifiedPushHelper.getEndpointOrToken() ?: "")
|
pushersManager.unregisterPusher(unifiedPushHelper.getEndpointOrToken().orEmpty())
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Timber.tag(loggerTag.value).d("Probably unregistering a non existant pusher")
|
Timber.tag(loggerTag.value).d("Probably unregistering a non existant pusher")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue