From 9886d9f49e07fdbc94e555acef98ae86d1fa7e9c Mon Sep 17 00:00:00 2001 From: iseulde Date: Fri, 9 Aug 2019 16:59:12 +0200 Subject: [PATCH] Ensure there's a selection before resetting it --- packages/block-editor/src/components/provider/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/provider/index.js b/packages/block-editor/src/components/provider/index.js index 55652871209ecd..f698d98ebfeb46 100644 --- a/packages/block-editor/src/components/provider/index.js +++ b/packages/block-editor/src/components/provider/index.js @@ -53,7 +53,10 @@ class BlockEditorProvider extends Component { this.isSyncingOutcomingValue = null; this.isSyncingIncomingValue = value; resetBlocks( value ); - resetSelection( selectionStart, selectionEnd ); + + if ( selectionStart && selectionEnd ) { + resetSelection( selectionStart, selectionEnd ); + } } }