Skip to content

Commit bb1e848

Browse files
fix old issue with migrating old colors
1 parent 4e55017 commit bb1e848

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/block/design-library/edit.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,15 @@ const createBlockWithAttributes = ( blockName, attributes, innerBlocks, design )
111111
// Recursively update the attributes of all inner blocks for the new Color Picker
112112
const migrateToNewColorPicker = blocks => {
113113
blocks?.forEach( block => {
114-
let newAttributes = block[ 1 ]
115-
newAttributes = deprecateContainerBackgroundColorOpacity.migrate( newAttributes )
116-
newAttributes = deprecateBlockBackgroundColorOpacity.migrate( newAttributes )
117-
newAttributes = deprecateTypographyGradientColor.migrate( '%s' )( newAttributes )
118-
block[ 1 ] = newAttributes
119-
migrateToNewColorPicker( block[ 2 ] )
114+
try {
115+
let newAttributes = block[ 1 ]
116+
newAttributes = deprecateContainerBackgroundColorOpacity.migrate( newAttributes )
117+
newAttributes = deprecateBlockBackgroundColorOpacity.migrate( newAttributes )
118+
newAttributes = deprecateTypographyGradientColor.migrate( '%s' )( newAttributes )
119+
block[ 1 ] = newAttributes
120+
migrateToNewColorPicker( block[ 2 ] )
121+
} catch ( error ) {
122+
}
120123
} )
121124
}
122125

0 commit comments

Comments
 (0)