Skip to content

Commit

Permalink
Merge pull request #9535 from wordpress-mobile/issue/805-Take-2-Aztec…
Browse files Browse the repository at this point in the history
…-NumberFormatException-in-CleaningUtils

Aztec - Log NumberFormatException in CleaningUtils
  • Loading branch information
jtreanor authored Apr 8, 2019
2 parents e7f5aa7 + 9ae9024 commit 047fbdd
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,21 @@ private void initializePostObject() {
mOriginalPostHadLocalChangesOnOpen = mOriginalPost.isLocallyChanged();
mPost = UploadService.updatePostWithCurrentlyCompletedUploads(mPost);
if (mShowAztecEditor) {
mMediaMarkedUploadingOnStartIds =
AztecEditorFragment.getMediaMarkedUploadingInPostContent(this, mPost.getContent());
Collections.sort(mMediaMarkedUploadingOnStartIds);
try {
mMediaMarkedUploadingOnStartIds =
AztecEditorFragment.getMediaMarkedUploadingInPostContent(this, mPost.getContent());
Collections.sort(mMediaMarkedUploadingOnStartIds);
} catch (NumberFormatException err) {
// see: https://github.com/wordpress-mobile/AztecEditor-Android/issues/805
if (getSite() != null && getSite().isWPCom() && !getSite().isPrivate()
&& TextUtils.isEmpty(mPost.getPassword())
&& !PostStatus.PRIVATE.toString().equals(mPost.getStatus())) {
AppLog.e(T.EDITOR, "There was an error initializing post object!");
AppLog.e(AppLog.T.EDITOR, "HTML content of the post before the crash:");
AppLog.e(AppLog.T.EDITOR, mPost.getContent());
throw err;
}
}
}
mIsPage = mPost.isPage();

Expand Down

0 comments on commit 047fbdd

Please sign in to comment.