Fix notice when viewing a post preview logged out. props SergeyBiryukov, fixes #19366.

git-svn-id: https://develop.svn.wordpress.org/trunk@19604 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-12-20 20:46:06 +00:00
parent fc512a48ae
commit 24a1c0ab4a
1 changed files with 1 additions and 1 deletions

View File

@ -2683,7 +2683,7 @@ class WP_Query {
}
}
if ( $this->is_preview && current_user_can( $edit_cap, $this->posts[0]->ID ) )
if ( $this->is_preview && $this->posts && current_user_can( $edit_cap, $this->posts[0]->ID ) )
$this->posts[0] = apply_filters_ref_array('the_preview', array( $this->posts[0], &$this ));
}