Skip to content

Conversation

@mkevins
Copy link
Contributor

@mkevins mkevins commented May 12, 2019

Description

This PR updates the Gutenberg reference to bring in the changes in this companion PR: WordPress/gutenberg#15532.

This PR adds a check to ensure attributes.url exists before attempting to call indexof. Currently, there are scenarios which can result in attributes.id being truthy, while attributes.url is null or undefined for an image block.

When an image is cancelled before it is finished uploading, the url is set to null, but the id of the block remains. The next time the post is edited, the local draft will contain the state which triggers the crash.

Testing steps:

This was tested using the steps here: wordpress-mobile/WordPress-Android#9768 (comment)

Types of changes

This is a bug fix for the crash discovered here: wordpress-mobile/WordPress-Android#9768

@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR is not assigned to a milestone.

Generated by 🚫 dangerJS

@mkevins
Copy link
Contributor Author

mkevins commented May 12, 2019

I fixed the hotfix version number and merged the previous PR into this one as per this comment: #967 (comment).

@hypest
Copy link
Contributor

hypest commented May 13, 2019

Headsup, let's hold off merging this one since there is a PR that got merged to the main apps that brings in the latest of gutenberg-mobile develop (which is currently broken though).

Also, please open a WPAndroid PR as well so we can track this better, thanks!

@mkevins
Copy link
Contributor Author

mkevins commented May 13, 2019

I have opened the PR on WPAndroid to update the submodule reference there to this one. The issues blocking the develop branch should be non-blocking here, as this PR targets master as a hotfix (assuming we go forward with that).

@daniloercoli daniloercoli self-requested a review May 13, 2019 14:40
Copy link
Contributor

@daniloercoli daniloercoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good!

@loremattei loremattei merged commit bd8743d into master May 13, 2019
@SergioEstevao SergioEstevao deleted the hotfix/v1.4.1 branch November 8, 2019 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants