Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 6312)
+++ /CKEditor/trunk/CHANGES.html	(revision 6313)
@@ -87,4 +87,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/6020">#6020</a> : Cut, Copy and Paste buttons' state are now aligned with the respective context menu buttons.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/5256">#5256</a> : JS error when percent sign used in image url.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6577">#6577</a> : [FF] Selection error when editor element is hidden.</li>
 	</ul>
 	<h3>
Index: /CKEditor/trunk/_source/plugins/selection/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 6312)
+++ /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 6313)
@@ -1376,6 +1376,10 @@
 
 				var selection = this.document.getSelection().getNative();
-				selection.removeAllRanges();
-				selection.addRange( nativeRange );
+				// getSelection() returns null in case when iframe is "display:none" in FF. (#6577)
+				if ( selection )
+				{
+					selection.removeAllRanges();
+					selection.addRange( nativeRange );
+				}
 			};
 } )();
