Index: /CKEditor/trunk/_source/plugins/preview/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/preview/plugin.js	(revision 4863)
+++ /CKEditor/trunk/_source/plugins/preview/plugin.js	(revision 4864)
@@ -30,10 +30,14 @@
 			{
 				var bodyHtml = '<body ',
-						body = editor.document.getBody();
+						body = editor.document && editor.document.getBody();
 
-				if ( body.getAttribute( 'id' ) )
-					bodyHtml += 'id="' + body.getAttribute( 'id' ) + '" ';
-				if ( body.getAttribute( 'class' ) )
-					bodyHtml += 'class="' + body.getAttribute( 'class' ) + '" ';
+				if ( body )
+				{
+					if ( body.getAttribute( 'id' ) )
+						bodyHtml += 'id="' + body.getAttribute( 'id' ) + '" ';
+					if ( body.getAttribute( 'class' ) )
+						bodyHtml += 'class="' + body.getAttribute( 'class' ) + '" ';
+				}
+
 				bodyHtml += '>';
 
