Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 4666)
+++ /CKEditor/trunk/CHANGES.html	(revision 4667)
@@ -158,4 +158,5 @@
 		<li><a href="http://dev.fckeditor.net/ticket/4519">#4519</a> : Fixed maximize without editor focus throw error in IE.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/4543">#4543</a> : Fixed unable to move cursor between table and hr.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4764">#4764</a> : Fixed wrong exception message when CKEDITOR.editor::append to non-existence element.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.fckeditor.net/ticket/3947">#3947</a> : Arabic;</li>
Index: /CKEditor/trunk/_source/core/editor_basic.js
===================================================================
--- /CKEditor/trunk/_source/core/editor_basic.js	(revision 4666)
+++ /CKEditor/trunk/_source/core/editor_basic.js	(revision 4667)
@@ -132,14 +132,15 @@
 	CKEDITOR.editor.appendTo = function( elementOrId, config )
 	{
-		if ( typeof elementOrId != 'object' )
+		var element = elementOrId;
+		if ( typeof element != 'object' )
 		{
-			elementOrId = document.getElementById( elementOrId );
+			element = document.getElementById( elementOrId );
 
-			if ( !elementOrId )
+			if( !element )
 				throw '[CKEDITOR.editor.appendTo] The element with id "' + elementOrId + '" was not found.';
 		}
 
 		// Create the editor instance.
-		return new CKEDITOR.editor( config, elementOrId, CKEDITOR.ELEMENT_MODE_APPENDTO );
+		return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO );
 	};
 
