Skip to content

Commit

Permalink
avoid ClassCastException on ItemLongClick in ConversationsListActivity
Browse files Browse the repository at this point in the history
could happen when using long click on header when using the conversation search

Exception java.lang.ClassCastException:
  at com.nextcloud.talk.conversationlist.ConversationsListActivity.onItemLongClick (ConversationsListActivity.kt:1027)
  at eu.davidea.viewholders.FlexibleViewHolder.onLongClick (FlexibleViewHolder.java:144)
  at android.view.View.performLongClickInternal (View.java:8240)
  at android.view.View.performLongClick (View.java:8198)
  at android.view.View.performLongClick (View.java:8216)
  at android.view.View$CheckForLongPress.run (View.java:30194)
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:246)
  at android.app.ActivityThread.main (ActivityThread.java:8653)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)

Signed-off-by: Marcel Hibbe <[email protected]>
  • Loading branch information
mahibi committed Jul 7, 2023
1 parent 927c632 commit 9c89d68
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1067,8 +1067,8 @@ class ConversationsListActivity :
Log.d(TAG, "sharing to multiple rooms not yet implemented. onItemLongClick is ignored.")
} else {
val clickedItem: Any? = adapter!!.getItem(position)
if (clickedItem != null) {
val conversation = (clickedItem as ConversationItem).model
if (clickedItem != null && clickedItem is ConversationItem) {
val conversation = clickedItem.model
conversationsListBottomDialog = ConversationsListBottomDialog(
this,
userManager.currentUser.blockingGet(),
Expand Down

0 comments on commit 9c89d68

Please sign in to comment.