Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

Hotfix - v1.3.1 - Fix crash on undefined image url - #980

Merged
mkevins merged 4 commits into
release/1.3.1from
hotfix/v1.3.1
May 14, 2019
Merged

mkevins merged 4 commits into
release/1.3.1from
hotfix/v1.3.1

Conversation

@mkevins

@mkevins mkevins commented May 14, 2019 •

Copy link
Copy Markdown
Contributor

Description

Note: This PR targets a new release branch v1.3.1 created from the gutenberg-mobile tag v1.3.0, which is used in WordPress-Android v12.3.1.

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

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
Copy Markdown
Warnings
⚠️ PR is not assigned to a milestone.

Generated by 🚫 dangerJS

@mkevins
mkevins changed the base branch from release/1.3.1 to master May 14, 2019 08:04
@mkevins
mkevins changed the base branch from master to release/1.3.1 May 14, 2019 08:04
@daniloercoli
daniloercoli self-requested a review May 14, 2019 09:52

@daniloercoli daniloercoli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested and worked fine.

@loremattei Could you please check the hashes again to ensure we're pointing to the right ones ;)

Once this merged we can release a new version of the editor. v1.3.1

@mkevins
mkevins merged commit 6eaab08 into release/1.3.1 May 14, 2019
@mkevins
mkevins deleted the hotfix/v1.3.1 branch May 14, 2019 10:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants