Skip to content

Commit

Permalink
fix: NPE in ContentPreviewViewer when click delete sticker
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Apr 3, 2024
1 parent 06d7da0 commit 22c7aaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -2209,6 +2209,7 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi
if (stickerSet == null) return;
cell.setSticker(stickerSet.documents.get(position), null, stickerSet, null, showEmoji, isEditModeEnabled);
cell.editModeIcon.setOnClickListener(v -> {
ContentPreviewViewer.getInstance().setDelegate(previewDelegate);
ContentPreviewViewer.getInstance().showMenuFor(cell);
});
}
Expand Down
Expand Up @@ -508,9 +508,11 @@ public void dismiss() {
icons.add(R.drawable.msg_edit);
actions.add(7);
}
items.add(LocaleController.getString(R.string.DeleteSticker));
icons.add(R.drawable.msg_delete);
actions.add(8);
if (delegate != null) {
items.add(LocaleController.getString(R.string.DeleteSticker));
icons.add(R.drawable.msg_delete);
actions.add(8);
}
}
}

Expand Down

0 comments on commit 22c7aaf

Please sign in to comment.