Skip to content

Commit

Permalink
Handle nullability of snackbarAttachView in WPMainActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
irfano committed Jun 21, 2024
1 parent 1fa2607 commit 2b90a20
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1394,10 +1394,11 @@ public 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 Down Expand Up @@ -1805,21 +1806,24 @@ public void onPostUploaded(OnPostUploaded event) {
}
}

mUploadUtilsWrapper.onPostUploadedSnackbarHandler(
this,
findViewById(R.id.coordinator),
event.isError(),
event.isFirstTimePublish,
event.post,
null,
targetSite,
isFirstTimePublishing -> {
mBloggingRemindersViewModel.onPublishingPost(targetSite.getId(), isFirstTimePublishing);
if (isFirstTimePublishing) {
AppReviewManager.INSTANCE.onPostPublished();
View snackbarAttachView = findViewById(R.id.coordinator);
if (snackbarAttachView != null) {
mUploadUtilsWrapper.onPostUploadedSnackbarHandler(
this,
snackbarAttachView,
event.isError(),
event.isFirstTimePublish,
event.post,
null,
targetSite,
isFirstTimePublishing -> {
mBloggingRemindersViewModel.onPublishingPost(targetSite.getId(), isFirstTimePublishing);
if (isFirstTimePublishing) {
AppReviewManager.INSTANCE.onPostPublished();
}
}
}
);
);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class UploadUtilsWrapper @Inject constructor(
@Suppress("LongParameterList")
fun onPostUploadedSnackbarHandler(
activity: Activity?,
snackbarAttachView: View?,
snackbarAttachView: View,
isError: Boolean,
isFirstTimePublish: Boolean,
post: PostModel?,
Expand Down

0 comments on commit 2b90a20

Please sign in to comment.