\r
editor.on( 'contentDomUnload', function()\r
{\r
- getSpaceElement().setHtml( emptyHtml );\r
+ // If the spaceElement hasn't been initialized, don't try to do it at this time\r
+ // Only reuse existing reference.\r
+ spaceElement && spaceElement.setHtml( emptyHtml );\r
});\r
\r
editor.addCommand( 'elementsPathFocus', commands.toolbarFocus );\r