Skip to content

Commit

Permalink
Add sanity check for featured image ID being possibly undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
pierlon committed Mar 27, 2020
1 parent 1a4e33c commit 7cfd2d6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default ( InitialMediaUpload, minImageDimensions ) => {
id = wp.media.view.settings.post.featuredImageId;
let attachment;

if ( '' !== id && -1 !== id ) {
if ( undefined !== id && '' !== id && -1 !== id ) {
attachment = wp.media.model.Attachment.get( id );
attachment.fetch();
}
Expand Down

0 comments on commit 7cfd2d6

Please sign in to comment.