Skip to content

Commit

Permalink
Block Editor: Fix Iframe error for links without 'href' (WordPress#68024
Browse files Browse the repository at this point in the history
)


Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: talldan <[email protected]>
  • Loading branch information
3 people authored and yogeshbhutkar committed Dec 18, 2024
1 parent 4b76a5a commit f723fb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function Iframe( {
// Appending a hash to the current URL will not reload the
// page. This is useful for e.g. footnotes.
const href = event.target.getAttribute( 'href' );
if ( href.startsWith( '#' ) ) {
if ( href?.startsWith( '#' ) ) {
iFrameDocument.defaultView.location.hash =
href.slice( 1 );
}
Expand Down

0 comments on commit f723fb2

Please sign in to comment.