mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-01 09:29:38 +01:00
catch NPE for popup bubble
catch NPE when popup bubble for unread mentions is not available anymore Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
600bb1ad41
commit
84468be617
@ -626,18 +626,23 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkToShowUnreadBubble() {
|
private void checkToShowUnreadBubble() {
|
||||||
int lastVisibleItem = layoutManager.findLastCompletelyVisibleItemPosition();
|
try{
|
||||||
for (AbstractFlexibleItem flexItem : callItems) {
|
int lastVisibleItem = layoutManager.findLastCompletelyVisibleItemPosition();
|
||||||
Conversation conversationItem = ((ConversationItem) flexItem).getModel();
|
for (AbstractFlexibleItem flexItem : callItems) {
|
||||||
int position = adapter.getGlobalPositionOf(flexItem);
|
Conversation conversationItem = ((ConversationItem) flexItem).getModel();
|
||||||
if (conversationItem.unreadMention && position > lastVisibleItem) {
|
int position = adapter.getGlobalPositionOf(flexItem);
|
||||||
if (!newMentionPopupBubble.isShown()){
|
if (conversationItem.unreadMention && position > lastVisibleItem) {
|
||||||
newMentionPopupBubble.show();
|
if (!newMentionPopupBubble.isShown()){
|
||||||
|
newMentionPopupBubble.show();
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
newMentionPopupBubble.hide();
|
||||||
|
} catch (NullPointerException e){
|
||||||
|
Log.d(TAG, "A NPE was caught when trying to show the unread popup bubble. This might happen when the " +
|
||||||
|
"user already left the conversations-list screen so the popup bubble is not available anymore.", e);
|
||||||
}
|
}
|
||||||
newMentionPopupBubble.hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showNewConversationsScreen() {
|
private void showNewConversationsScreen() {
|
||||||
|
Loading…
Reference in New Issue
Block a user