Skip to content

Commit

Permalink
Add check for EditPostRepository property has been initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
zwarm committed Jun 7, 2024
1 parent 6162e6e commit 08efcdc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3813,7 +3813,10 @@ class EditPostActivity : LocaleAwareActivity(), EditorFragmentActivity, EditorIm
@Subscribe(threadMode = ThreadMode.MAIN)
fun onPostUploaded(event: OnPostUploaded) {
val post: PostModel? = event.post
val editPostId = editPostRepository.getPost()?.id

// Check if editPostRepository is initialized
val editPostRepositoryInitialized = this::editPostRepository.isInitialized
val editPostId = if (editPostRepositoryInitialized) editPostRepository.getPost()?.id else null

if (post != null && post.id == editPostId) {
if (!isRemotePreviewingFromEditor) {
Expand Down

0 comments on commit 08efcdc

Please sign in to comment.