Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 22086)
+++ wp-includes/query.php	(working copy)
@@ -2774,15 +2774,15 @@
 
 		$this->post_count = count( $this->posts );
 
-		// Always sanitize
-		foreach ( $this->posts as $i => $post ) {
-			$this->posts[$i] = sanitize_post( $post, 'raw' );
-		}
+		if ( $this->post_count > 0 ) {
+			// Always sanitize
+			foreach ( $this->posts as $i => $post ) {
+				$this->posts[$i] = sanitize_post( $post, 'raw' );
+			}
 
-		if ( $q['cache_results'] )
-			update_post_caches($this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache']);
-
-		if ( $this->post_count > 0 ) {
+			if ( $q['cache_results'] )
+				update_post_caches($this->posts, $post_type, $q['update_post_term_cache'], $q['update_post_meta_cache']);			
+			
 			$this->post = $this->posts[0];
 		}
 
