mirror of
https://github.com/nextcloud/talk-android
synced 2025-08-03 10:05:28 +01:00
Merge pull request #1933 from nextcloud/bugfix/1893/fixCrashWhenClickOnSearchHeader
avoid crash when clicking on header in conversation search mode
This commit is contained in:
commit
eeba4877b7
@ -626,7 +626,7 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchOpenConversations(int apiVersion){
|
private void fetchOpenConversations(int apiVersion) {
|
||||||
searchableConversationItems.clear();
|
searchableConversationItems.clear();
|
||||||
searchableConversationItems.addAll(conversationItemsWithHeader);
|
searchableConversationItems.addAll(conversationItemsWithHeader);
|
||||||
|
|
||||||
@ -857,6 +857,7 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemClick(View view, int position) {
|
public boolean onItemClick(View view, int position) {
|
||||||
|
try {
|
||||||
selectedConversation = ((ConversationItem) Objects.requireNonNull(adapter.getItem(position))).getModel();
|
selectedConversation = ((ConversationItem) Objects.requireNonNull(adapter.getItem(position))).getModel();
|
||||||
if (selectedConversation != null && getActivity() != null) {
|
if (selectedConversation != null && getActivity() != null) {
|
||||||
if (showShareToScreen) {
|
if (showShareToScreen) {
|
||||||
@ -869,6 +870,10 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
openConversation();
|
openConversation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
Log.w(TAG, "failed to cast clicked item to ConversationItem. Most probably a heading was clicked. This is" +
|
||||||
|
" just ignored.", e);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user