Skip to content

Commit

Permalink
Handle nullability of snackbarAttachView in ReaderPostPagerActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
irfano committed Jun 21, 2024
1 parent 2b90a20 commit 220b498
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1091,10 +1091,11 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
break;
}

if (site != null && post != null) {
View snackbarAttachView = findViewById(R.id.coordinator);
if (site != null && post != null && snackbarAttachView != null) {
mUploadUtilsWrapper.handleEditPostResultSnackbars(
this,
findViewById(R.id.coordinator),
snackbarAttachView,
data,
post,
site,
Expand All @@ -1119,10 +1120,11 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
@Subscribe(threadMode = ThreadMode.MAIN)
public void onPostUploaded(OnPostUploaded event) {
SiteModel site = mSiteStore.getSiteByLocalId(mSelectedSiteRepository.getSelectedSiteLocalId());
if (site != null && event.post != null) {
View snackbarAttachView = findViewById(R.id.coordinator);
if (site != null && event.post != null && snackbarAttachView != null) {
mUploadUtilsWrapper.onPostUploadedSnackbarHandler(
this,
findViewById(R.id.coordinator),
snackbarAttachView,
event.isError(),
event.isFirstTimePublish,
event.post,
Expand Down

0 comments on commit 220b498

Please sign in to comment.