Index: _source/plugins/div/dialogs/div.js
===================================================================
--- _source/plugins/div/dialogs/div.js	(revision 5886)
+++ _source/plugins/div/dialogs/div.js	(revision )
@@ -508,7 +508,8 @@
 			},
 			onHide : function()
 			{
-				this._element.removeCustomData( 'elementStyle' );
+				// Remove custom style only when editing existing DIV. (#6108)
+				this._element && this._element.removeCustomData( 'elementStyle' );
 				delete this._element;
 			}
 		};
