mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-28 09:38:14 +03:00
avoid NPE when answering call
this could happen very rarely when clicking very fast to accept the call before the conversation was set. Exception java.lang.NullPointerException: at com.nextcloud.talk.activities.CallNotificationActivity.proceedToCall (CallNotificationActivity.kt:156) at com.nextcloud.talk.activities.CallNotificationActivity.initClickListeners$lambda$0 (CallNotificationActivity.kt:126) at com.nextcloud.talk.activities.CallNotificationActivity.$r8$lambda$0cnB_UmYcTD4PyxIBSZCZs1m_6s at com.nextcloud.talk.activities.CallNotificationActivity$$ExternalSyntheticLambda0.onClick at android.view.View.performClick (View.java:6612) at android.view.View.performClickInternal (View.java:6581) at android.view.View.access$3100 (View.java:785) at android.view.View$PerformClick.run (View.java:25904) at android.os.Handler.handleCallback (Handler.java:873) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:280) at android.app.ActivityThread.main (ActivityThread.java:6706) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:858) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
f493c84108
commit
11d089485e
1 changed files with 21 additions and 17 deletions
|
@ -153,6 +153,7 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun proceedToCall() {
|
private fun proceedToCall() {
|
||||||
|
if (currentConversation != null) {
|
||||||
originalBundle!!.putString(KEY_ROOM_TOKEN, currentConversation!!.token)
|
originalBundle!!.putString(KEY_ROOM_TOKEN, currentConversation!!.token)
|
||||||
originalBundle!!.putString(KEY_CONVERSATION_NAME, currentConversation!!.displayName)
|
originalBundle!!.putString(KEY_CONVERSATION_NAME, currentConversation!!.displayName)
|
||||||
|
|
||||||
|
@ -172,6 +173,9 @@ class CallNotificationActivity : CallBaseActivity() {
|
||||||
val intent = Intent(this, CallActivity::class.java)
|
val intent = Intent(this, CallActivity::class.java)
|
||||||
intent.putExtras(originalBundle!!)
|
intent.putExtras(originalBundle!!)
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
|
} else {
|
||||||
|
Log.w(TAG, "conversation was still null when clicked to answer call. User has to click another time.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("MagicNumber")
|
@Suppress("MagicNumber")
|
||||||
|
|
Loading…
Reference in a new issue