Index: /FCKeditor/trunk/_whatsnew.html
===================================================================
--- /FCKeditor/trunk/_whatsnew.html	(revision 1725)
+++ /FCKeditor/trunk/_whatsnew.html	(revision 1726)
@@ -91,4 +91,6 @@
 			will no longer remain behind in the editing area when the placeholder dialog is
 			opened.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed
+			JavaScript error in IE when the user tries to open dialogs in Source mode.</li>
 	</ul>
 	<h3>
Index: /FCKeditor/trunk/editor/_source/internals/fckdialog.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckdialog.js	(revision 1725)
+++ /FCKeditor/trunk/editor/_source/internals/fckdialog.js	(revision 1726)
@@ -108,5 +108,7 @@
 				currentInstance.Focus() ;
 
-				var editorDocument = currentInstance.EditorDocument ;
+				var editorDocument = ( currentInstance.EditMode == FCK_EDITMODE_WYSIWYG ?
+						currentInstance.EditorDocument :
+						FCKTools.GetElementDocument( currentInstance.EditingArea.Textarea ) ) ;
 				var selection = editorDocument.selection ;
 				var range ;
