diff --git src/wp-includes/post.php src/wp-includes/post.php
index ff332e2..38a049d 100644
--- src/wp-includes/post.php
+++ src/wp-includes/post.php
@@ -2122,7 +2122,7 @@ function sanitize_post( $post, $context = 'display' ) {
 		foreach ( array_keys(get_object_vars($post)) as $field )
 			$post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context);
 		$post->filter = $context;
-	} else {
+	} elseif ( is_array( $post ) ) {
 		// Check if post already filtered for this context.
 		if ( isset($post['filter']) && $context == $post['filter'] )
 			return $post;
