mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 17:08:34 +03:00
Avoid NPE in setupSwipeToReply
Exception java.lang.NullPointerException: at com.nextcloud.talk.controllers.ChatController.setupSwipeToReply (ChatController.kt:419) at com.nextcloud.talk.controllers.ChatController.access$setupSwipeToReply (ChatController.kt:221) at com.nextcloud.talk.controllers.ChatController$getRoomInfo$1.onNext (ChatController.kt:378) at com.nextcloud.talk.controllers.ChatController$getRoomInfo$1.onNext (ChatController.kt:362) at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal (ObservableObserveOn.java:201) at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run (ObservableObserveOn.java:255) at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run (HandlerScheduler.java:124) at android.os.Handler.handleCallback (Handler.java:883) at android.os.Handler.dispatchMessage (Handler.java:100) at android.os.Looper.loop (Looper.java:237) at android.app.ActivityThread.main (ActivityThread.java:7830) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1040) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
bf32d9e457
commit
a941be5276
1 changed files with 12 additions and 10 deletions
|
@ -415,18 +415,20 @@ class ChatController(args: Bundle) :
|
|||
participantPermissions.hasChatPermission() &&
|
||||
!isReadOnlyConversation()
|
||||
) {
|
||||
val messageSwipeController = MessageSwipeCallback(
|
||||
activity!!,
|
||||
object : MessageSwipeActions {
|
||||
override fun showReplyUI(position: Int) {
|
||||
val chatMessage = adapter?.items?.get(position)?.item as ChatMessage?
|
||||
replyToMessage(chatMessage)
|
||||
activity?.let {
|
||||
val messageSwipeController = MessageSwipeCallback(
|
||||
it,
|
||||
object : MessageSwipeActions {
|
||||
override fun showReplyUI(position: Int) {
|
||||
val chatMessage = adapter?.items?.get(position)?.item as ChatMessage?
|
||||
replyToMessage(chatMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
val itemTouchHelper = ItemTouchHelper(messageSwipeController)
|
||||
itemTouchHelper.attachToRecyclerView(binding?.messagesListView)
|
||||
val itemTouchHelper = ItemTouchHelper(messageSwipeController)
|
||||
itemTouchHelper.attachToRecyclerView(binding?.messagesListView)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue