Skip to content

Commit

Permalink
fix (map block): fix error when there is no icon provided (#3362)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkae authored Nov 5, 2024
1 parent d4f76c7 commit 5765141
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/block/map/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ import { addFilter } from '@wordpress/hooks'

const getIconOptions_3_13_0 = attributes => {
const newAttributes = { ...attributes }
if ( ! attributes.icon ) {
return null
}
const svgEl = createElementFromHTMLString( attributes.icon )

if ( ! svgEl || ! svgEl.firstElementChild ) {
return null
}
svgEl.firstElementChild.setAttribute( 'fill', 'currentColor' )
newAttributes.icon = svgEl.outerHTML
return getIconOptions( newAttributes )
Expand Down

0 comments on commit 5765141

Please sign in to comment.