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
This commit is contained in:
ryan 2006-03-03 02:14:31 +00:00
parent b3214d6cc8
commit 18db892b64
1 changed files with 1 additions and 1 deletions

View File

@ -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) ) {