Skip to content

Commit

Permalink
add null check
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkae committed Oct 30, 2024
1 parent d4f76c7 commit 8c3450e
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 8c3450e

Please sign in to comment.