Index: _source/core/dom/element.js
===================================================================
--- _source/core/dom/element.js	(revision 7185)
+++ _source/core/dom/element.js	(working copy)
@@ -1479,7 +1479,7 @@
 				}
 			}
 
-			return $ && new CKEDITOR.dom.document( $.contentWindow.document );
+			return $ && $.contentWindow && new CKEDITOR.dom.document( $.contentWindow.document );
 		},
 
 		/**
Index: _source/plugins/wysiwygarea/plugin.js
===================================================================
--- _source/plugins/wysiwygarea/plugin.js	(revision 7185)
+++ _source/plugins/wysiwygarea/plugin.js	(working copy)
@@ -1032,6 +1032,9 @@
 									xmlDeclaration = fullPage && editor.xmlDeclaration,
 									doc = iframe.getFrameDocument();
 
+								if ( !doc )
+									return null;
+
 								var data = fullPage
 									? doc.getDocumentElement().getOuterHtml()
 									: doc.getBody().getHtml();
