Index: wp-includes/general-template.php
===================================================================
--- wp-includes/general-template.php	(revision 4413)
+++ wp-includes/general-template.php	(working copy)
@@ -750,13 +750,20 @@
 		echo "<meta name='robots' content='noindex,nofollow' />\n";
 }
 
+function rich_edit_exists() {
+	global $wp_rich_edit_exists;
+	if ( !isset($wp_rich_edit_exists) )
+		$wp_rich_edit_exists = file_exists(ABSPATH . WPINC . '/js/tinymce/tiny_mce.js');
+	return $wp_rich_edit_exists;
+}
+
 function user_can_richedit() {
-	$can = true;
+	global $wp_rich_edit;
+	
+	if ( !isset($wp_rich_edit) )
+		$wp_rich_edit = ( 'true' == get_user_option('rich_editing') && !preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) && rich_edit_exists() ) ? true : false;
 
-	if ( 'true' != get_user_option('rich_editing') || preg_match('!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT']) )
-		$can = false;
-
-	return apply_filters('user_can_richedit', $can);
+	return apply_filters('user_can_richedit', $wp_rich_edit);
 }
 
 function the_editor($content, $id = 'content', $prev_id = 'title') {
Index: wp-admin/profile-update.php
===================================================================
--- wp-admin/profile-update.php	(revision 4413)
+++ wp-admin/profile-update.php	(working copy)
@@ -17,9 +17,11 @@
 	exit;
 }
 
-if ( !isset( $_POST['rich_editing'] ) )
-	$_POST['rich_editing'] = 'false';
-update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true );
+if ( rich_edit_exists() ) {
+	if ( !isset( $_POST['rich_editing'] ) )
+		$_POST['rich_editing'] = 'false';
+	update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true );
+}
 
 do_action('personal_options_update');
 
Index: wp-admin/admin-functions.php
===================================================================
--- wp-admin/admin-functions.php	(revision 4413)
+++ wp-admin/admin-functions.php	(working copy)
@@ -287,12 +287,10 @@
 
 // Get an existing post and format it for editing.
 function get_post_to_edit($id) {
-	global $richedit;
-	$richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false;
 
 	$post = get_post($id);
 
-	$post->post_content = format_to_edit($post->post_content, $richedit);
+	$post->post_content = format_to_edit($post->post_content, user_can_richedit());
 	$post->post_content = apply_filters('content_edit_pre', $post->post_content);
 
 	$post->post_excerpt = format_to_edit($post->post_excerpt);
@@ -350,12 +348,9 @@
 }
 
 function get_comment_to_edit($id) {
-	global $richedit;
-	$richedit = ( 'true' == get_user_option('rich_editing') ) ? true : false;
-
 	$comment = get_comment($id);
 
-	$comment->comment_content = format_to_edit($comment->comment_content, $richedit);
+	$comment->comment_content = format_to_edit($comment->comment_content, user_can_richedit());
 	$comment->comment_content = apply_filters('comment_edit_pre', $comment->comment_content);
 
 	$comment->comment_author = format_to_edit($comment->comment_author);
Index: wp-admin/profile.php
===================================================================
--- wp-admin/profile.php	(revision 4413)
+++ wp-admin/profile.php	(working copy)
@@ -30,8 +30,10 @@
 
 <h3><?php _e('Personal Options'); ?></h3>
 
+<?php if ( rich_edit_exists() ) : // don't bother showing the option if the editor has been removed ?>
 <p><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', get_user_option('rich_editing')); ?> />
 <?php _e('Use the visual editor when writing') ?></label></p>
+<?php endif; ?>
 
 <?php do_action('profile_personal_options'); ?>
 

