Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 3453)
+++ wp-includes/functions.php	(working copy)
@@ -1681,6 +1681,10 @@
 }
 
 function get_template() {
+	if ( !file_exists(get_theme_root() . '/' . get_settings('template')) ) { // works for dirs too
+		update_option('template', 'default');
+		update_option('stylesheet', 'default');
+	}
 	return apply_filters('template', get_settings('template'));
 }
 
