Skip to content

Commit

Permalink
Add console.warn and comments to help track WordPress-Android issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkevins committed May 14, 2019
1 parent 7333d0c commit 9ccb408
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ class ImageEdit extends React.Component {

const { attributes, setAttributes } = this.props;

// This will warn when we have `id` defined, while `url` is undefined.
// This may help track this issue: https://github.com/wordpress-mobile/WordPress-Android/issues/9768
// where a cancelled image upload was resulting in a subsequent crash.
if ( attributes.id && ! attributes.url ) {
console.warn( "Attributes has id with no url." );
}

if ( attributes.id && attributes.url && ! isURL( attributes.url ) ) {
if ( attributes.url.indexOf( 'file:' ) === 0 ) {
requestMediaImport( attributes.url, ( mediaId, mediaUri ) => {
Expand Down

0 comments on commit 9ccb408

Please sign in to comment.