Skip to content

[Mobile] Hotfix release v1.3.1 - Fix crash on undefined image url - #15618

Merged
mkevins merged 3 commits into
gbmobile/disable-list-block-on-androidfrom
rnmobile/hotfix-release-v1.3.1
May 14, 2019
Merged

mkevins merged 3 commits into
gbmobile/disable-list-block-on-androidfrom
rnmobile/hotfix-release-v1.3.1

Conversation

@mkevins

@mkevins mkevins commented May 14, 2019

Copy link
Copy Markdown
Contributor

Description

Note: This PR targets the gutenberg branch used for the v1.3.0 release of gutenberg-mobile, which is used in WordPress-Android v12.3.1.

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.

How has this been tested?

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

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@mkevins mkevins added [Type] Bug An existing feature does not function as intended Mobile Web Viewport sizes for mobile and tablet devices [Block] Image Affects the Image Block labels May 14, 2019
@daniloercoli
daniloercoli self-requested a review May 14, 2019 09:56

@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 by following instructions provided in wordpress-mobile/WordPress-Android#9856

LGTM!

@mkevins
mkevins merged commit 5954265 into gbmobile/disable-list-block-on-android May 14, 2019
@mkevins
mkevins deleted the rnmobile/hotfix-release-v1.3.1 branch May 14, 2019 09:58
@youknowriad youknowriad modified the milestone: 5.7 (Gutenberg) May 14, 2019
@gziolo gziolo added Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) and removed Mobile Web Viewport sizes for mobile and tablet devices labels Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Image Affects the Image Block Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants