Index: wp-includes/comment-template.php
===================================================================
--- wp-includes/comment-template.php	(revision 21398)
+++ wp-includes/comment-template.php	(working copy)
@@ -818,7 +818,7 @@
 
 	if ( current_user_can( 'unfiltered_html' ) ) {
 		wp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false );
-		echo "<script>(function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();</script>\n";
+		echo "<script>(function(){var comment_disabled = document.getElementById('_wp_unfiltered_html_comment_disabled'); if(window===window.parent && comment_disabled !== null){comment_disabled.name='_wp_unfiltered_html_comment';}})();</script>\n";
 	}
 }
 
