Index: _whatsnew.html
===================================================================
--- _whatsnew.html	(revision 1775)
+++ _whatsnew.html	(working copy)
@@ -115,6 +115,9 @@
 		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE,
 			the browser was able to enter in an infinite loop when working with multiple editors
 			in the same page. </li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2042">#2042</a>] The FitWindow
+			command was throwing an error if executed in an editor where its relative button
+			is not present in the toolbar.</li>
 	</ul>
 	<h3>
 		Version 2.6 Beta 1</h3>
Index: editor/_source/classes/fcktoolbarbutton.js
===================================================================
--- editor/_source/classes/fcktoolbarbutton.js	(revision 1775)
+++ editor/_source/classes/fcktoolbarbutton.js	(working copy)
@@ -48,14 +48,19 @@
 
 FCKToolbarButton.prototype.RefreshState = function()
 {
+	var uiButton = this._UIButton ;
+
+	if ( !uiButton )
+		return ;
+
 	// Gets the actual state.
 	var eState = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).GetState() ;
 
 	// If there are no state changes than do nothing and return.
-	if ( eState == this._UIButton.State ) return ;
+	if ( eState == uiButton.State ) return ;
 
 	// Sets the actual state.
-	this._UIButton.ChangeState( eState ) ;
+	uiButton.ChangeState( eState ) ;
 }
 
 FCKToolbarButton.prototype.Click = function()
