Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix? NPE for currentUser in ConversationList #4443

Closed
wants to merge 1 commit into from

Commits on Nov 13, 2024

  1. fix? NPE for currentUser in ConversationList

    On gplay console this was reported (not often).
    
    It looks like currentUser could be null when getRoomsFlow is updated.
    
    Maybe for some cases initialization was too late in onResume, so moved to onCreate. Not reproduced/tested though.
    
    Exception java.lang.NullPointerException:
      at com.nextcloud.talk.conversationlist.ConversationsListActivity.addToConversationItems (ConversationsListActivity.kt:837)
      at com.nextcloud.talk.conversationlist.ConversationsListActivity.access$addToConversationItems (ConversationsListActivity.kt:149)
      at com.nextcloud.talk.conversationlist.ConversationsListActivity$initObservers$5$1.invokeSuspend (ConversationsListActivity.kt:379)
      at com.nextcloud.talk.conversationlist.ConversationsListActivity$initObservers$5$1.invoke (Unknown Source:8)
      at com.nextcloud.talk.conversationlist.ConversationsListActivity$initObservers$5$1.invoke (Unknown Source:4)
      at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit (Emitters.kt:219)
      at kotlinx.coroutines.flow.FlowKt__ErrorsKt$catchImpl$2.emit (Errors.kt:154)
      at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit (Emitters.kt:220)
      at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl (SharedFlow.kt:392)
      at kotlinx.coroutines.flow.SharedFlowImpl.collect (Unknown Source)
      at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.collect (SafeCollector.common.kt:112)
      at kotlinx.coroutines.flow.FlowKt__ErrorsKt.catchImpl (Errors.kt:152)
      at kotlinx.coroutines.flow.FlowKt.catchImpl (Unknown Source:1)
      at kotlinx.coroutines.flow.FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1.collect (SafeCollector.common.kt:112)
      at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.collect (SafeCollector.common.kt:112)
      at kotlinx.coroutines.flow.FlowKt__CollectKt.collect (Collect.kt:26)
      at kotlinx.coroutines.flow.FlowKt.collect (Unknown Source:1)
      at com.nextcloud.talk.conversationlist.ConversationsListActivity$initObservers$5.invokeSuspend (ConversationsListActivity.kt:396)
      at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
      at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith (DispatchedContinuation.kt:363)
      at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable (Cancellable.kt:26)
      at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default (Cancellable.kt:21)
      at kotlinx.coroutines.CoroutineStart.invoke (CoroutineStart.kt:88)
      at kotlinx.coroutines.AbstractCoroutine.start (AbstractCoroutine.kt:123)
      at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch (Builders.common.kt:52)
      at kotlinx.coroutines.BuildersKt.launch (Unknown Source:1)
      at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default (Builders.common.kt:43)
      at kotlinx.coroutines.BuildersKt.launch$default (Unknown Source:1)
      at com.nextcloud.talk.conversationlist.ConversationsListActivity.initObservers (ConversationsListActivity.kt:372)
      at com.nextcloud.talk.conversationlist.ConversationsListActivity.onCreate (ConversationsListActivity.kt:246)
      at android.app.Activity.performCreate (Activity.java:8595)
      at android.app.Activity.performCreate (Activity.java:8573)
      at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1475)
      at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3855)
      at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:4013)
      at android.app.ActivityThread.handleRelaunchActivityInner (ActivityThread.java:6056)
      at android.app.ActivityThread.handleRelaunchActivity (ActivityThread.java:5952)
      at android.app.servertransaction.ActivityRelaunchItem.execute (ActivityRelaunchItem.java:76)
      at android.app.servertransaction.ActivityTransactionItem.execute (ActivityTransactionItem.java:45)
      at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:139)
      at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:96)
      at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2514)
      at android.os.Handler.dispatchMessage (Handler.java:106)
      at android.os.Looper.loopOnce (Looper.java:232)
      at android.os.Looper.loop (Looper.java:334)
      at android.app.ActivityThread.main (ActivityThread.java:8293)
      at java.lang.reflect.Method.invoke
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578)
      at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1053)
    
    Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
    mahibi committed Nov 13, 2024
    Configuration menu
    Copy the full SHA
    6bf379c View commit details
    Browse the repository at this point in the history