From 18db892b645946029232f2fb1bf0c23f521f94ae Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 3 Mar 2006 02:14:31 +0000 Subject: [PATCH] Make sure posts array is not empty before checking preview state. #2498 git-svn-id: http://svn.automattic.com/wordpress/trunk@3600 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/classes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index d777f9555d..0667b8f01f 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -654,7 +654,7 @@ class WP_Query { $this->posts = $wpdb->get_results($this->request); // Check post status to determine if post should be displayed. - if ($this->is_single || $this->is_page) { + if ( !empty($this->posts) && $this->is_single || $this->is_page ) { $status = get_post_status($this->posts[0]); //$type = get_post_type($this->posts[0]); if ( ('publish' != $status) ) {