Index: /FCKeditor/trunk/editor/_source/classes/fckdomrange_gecko.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckdomrange_gecko.js	(revision 1068)
+++ /FCKeditor/trunk/editor/_source/classes/fckdomrange_gecko.js	(revision 1069)
@@ -36,5 +36,6 @@
 	}
 	else
-		this.MoveToElementStart( this.Window.document.body ) ;
+		if ( this.Window.document )
+			this.MoveToElementStart( this.Window.document.body ) ;
 }
 
Index: /FCKeditor/trunk/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckdomtools.js	(revision 1068)
+++ /FCKeditor/trunk/editor/_source/internals/fckdomtools.js	(revision 1069)
@@ -395,11 +395,26 @@
 	{
 		// In IE it can happen when the page is reloaded that doc or doc.body is null, so exit here
-		if ( !doc || !doc.body )
+		try
+		{
+			if ( !doc || !doc.body )
+				return ;
+		}
+		catch (e)
+		{
 			return ;
+		}
 
 		this.CheckAndRemovePaddingNode( doc, tagName, true ) ;
-		if ( doc.body.lastChild && ( doc.body.lastChild.nodeType != 1
-				|| doc.body.lastChild.tagName.toLowerCase() == tagName.toLowerCase() ) )
+		try
+		{
+			if ( doc.body.lastChild && ( doc.body.lastChild.nodeType != 1
+					|| doc.body.lastChild.tagName.toLowerCase() == tagName.toLowerCase() ) )
+				return ;
+		}
+		catch (e)
+		{
 			return ;
+		}
+
 		var node = doc.createElement( tagName ) ;
 		if ( FCKBrowserInfo.IsGecko && FCKListsLib.NonEmptyBlockElements[ tagName ] )
@@ -423,12 +438,20 @@
 
 		// If the padding node is changed, remove its status as a padding node.
-		if ( paddingNode.parentNode != doc.body
-			|| paddingNode.tagName.toLowerCase() != tagName
-			|| ( paddingNode.childNodes.length > 1 )
-			|| ( paddingNode.firstChild && paddingNode.firstChild.nodeValue != '\xa0'
-				&& String(paddingNode.firstChild.tagName).toLowerCase() != 'br' ) )
-		{
-			this.PaddingNode = null ;
-			return ;
+		try
+		{
+			if ( paddingNode.parentNode != doc.body
+				|| paddingNode.tagName.toLowerCase() != tagName
+				|| ( paddingNode.childNodes.length > 1 )
+				|| ( paddingNode.firstChild && paddingNode.firstChild.nodeValue != '\xa0'
+					&& String(paddingNode.firstChild.tagName).toLowerCase() != 'br' ) )
+			{
+				this.PaddingNode = null ;
+				return ;
+			}
+		}
+		catch (e)
+		{
+				this.PaddingNode = null ;
+				return ;
 		}
 
