From 5967fd3b6ebe8746f35fb9eaba2b6fca13981cbf Mon Sep 17 00:00:00 2001 From: Cameron Voell Date: Mon, 25 Nov 2019 19:00:25 -0800 Subject: [PATCH] Avoid crash on undefined node.parentElement.closest, causing crash on mobile when pasting formatted text. --- packages/blocks/src/api/raw-handling/html-formatting-remover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/blocks/src/api/raw-handling/html-formatting-remover.js b/packages/blocks/src/api/raw-handling/html-formatting-remover.js index 615feb80508a9..d097f8323bd10 100644 --- a/packages/blocks/src/api/raw-handling/html-formatting-remover.js +++ b/packages/blocks/src/api/raw-handling/html-formatting-remover.js @@ -42,7 +42,7 @@ export default function( node ) { } // Ignore pre content. - if ( node.parentElement.closest( 'pre' ) ) { + if ( node.parentElement.closest && node.parentElement.closest( 'pre' ) ) { return; }