Skip to content

Commit

Permalink
fix NPE currentConversation!!.internalId
Browse files Browse the repository at this point in the history
followup to PR #4439

Exception java.lang.NullPointerException:
  at com.nextcloud.talk.chat.MessageInputFragment.handleMessageQueue (MessageInputFragment.kt:251)
  at com.nextcloud.talk.chat.MessageInputFragment.access$handleMessageQueue (MessageInputFragment.kt:82)
  at com.nextcloud.talk.chat.MessageInputFragment$initObservers$4$1.invokeSuspend (MessageInputFragment.kt:192)
  at com.nextcloud.talk.chat.MessageInputFragment$initObservers$4$1.invoke (Unknown Source:12)
  at com.nextcloud.talk.chat.MessageInputFragment$initObservers$4$1.invoke (Unknown Source:8)
  at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit (Emitters.kt:219)
  at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt (Channels.kt:33)
  at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl$FlowKt__ChannelsKt (Channels.kt:1)
  at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend (Unknown Source:14)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:104)
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:241)
  at android.os.Looper.loop (Looper.java:342)
  at android.app.ActivityThread.main (ActivityThread.java:8128)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:583)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1045)

Signed-off-by: Marcel Hibbe <[email protected]>
  • Loading branch information
mahibi committed Nov 15, 2024
1 parent 026bb92 commit 6dd7479
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class MessageInputFragment : Fragment() {
if (isOnline) {
chatActivity.messageInputViewModel.switchToMessageQueue(false)
chatActivity.messageInputViewModel.sendAndEmptyMessageQueue(
chatActivity.currentConversation!!.internalId,
conversationInternalId,
chatActivity.conversationUser!!.getCredentials(),
ApiUtils.getUrlForChat(
chatActivity.chatApiVersion,
Expand Down Expand Up @@ -796,7 +796,7 @@ class MessageInputFragment : Fragment() {

private fun sendMessage(message: CharSequence, replyTo: Int?, sendWithoutNotification: Boolean) {
chatActivity.messageInputViewModel.sendChatMessage(
chatActivity.currentConversation!!.internalId,
conversationInternalId,
chatActivity.conversationUser!!.getCredentials(),
ApiUtils.getUrlForChat(
chatActivity.chatApiVersion,
Expand Down

0 comments on commit 6dd7479

Please sign in to comment.