Don't show comments template if post is empty

git-svn-id: https://develop.svn.wordpress.org/trunk@11839 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-08-18 19:33:56 +00:00
parent f4f70a6479
commit 1a2506c493
1 changed files with 1 additions and 1 deletions

View File

@ -813,7 +813,7 @@ function wp_comment_form_unfiltered_html_nonce() {
function comments_template( $file = '/comments.php', $separate_comments = false ) {
global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
if ( ! (is_single() || is_page() || $withcomments) )
if ( !(is_single() || is_page() || $withcomments) || empty($post) )
return;
if ( empty($file) )