Skip to content

Commit

Permalink
Check if maxwidth exists before trying to call .length (#21785)
Browse files Browse the repository at this point in the history
  • Loading branch information
thedebian authored Nov 17, 2021
1 parent ac26853 commit 13e4843
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Fix VideoPress load for old videos in Gutenberg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const VideoPressSave = CoreVideoSave => props => {
} );

let embedWrapperStyle = {};
if ( maxWidth.length > 0 && '100%' !== maxWidth ) {
if ( maxWidth && maxWidth.length > 0 && '100%' !== maxWidth ) {
embedWrapperStyle = {
maxWidth,
margin: 'auto',
Expand Down

0 comments on commit 13e4843

Please sign in to comment.