From ea4cecf6eb63a84b3fdfa9a0b5b1935dbfbacd5d Mon Sep 17 00:00:00 2001 From: emc3 Date: Wed, 24 Mar 2004 14:45:48 +0000 Subject: [PATCH] Check $comment_counts before using. git-svn-id: http://svn.automattic.com/wordpress/trunk@992 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-blog-header.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index e4f1f760c8..698495e84f 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -449,9 +449,11 @@ if ($posts) { WHERE post_status = 'publish' AND ID IN ($post_id_list) GROUP BY ID"); - foreach ($comment_counts as $comment_count) { - $comment_count_cache["$comment_count->ID"] = $comment_count->ccount; - } + if ($comment_counts) { + foreach ($comment_counts as $comment_count) { + $comment_count_cache["$comment_count->ID"] = $comment_count->ccount; + } + } // Get post-meta info if ( $meta_list = $wpdb->get_results("