Index: src/wp-includes/comment.php
===================================================================
--- src/wp-includes/comment.php	(revision 35829)
+++ src/wp-includes/comment.php	(working copy)
@@ -2010,13 +2010,18 @@
  * @param bool $do_deferred Whether to process previously deferred post comment counts
  * @return bool|void True on success, false on failure
  */
-function wp_update_comment_count($post_id, $do_deferred=false) {
+function wp_update_comment_count( $post_id, $do_deferred = false ) {
 	static $_deferred = array();

+	$post_id = (int) $post_id;
+	if ( ! $post_id ) {
+		return false;
+	}
+
 	if ( $do_deferred ) {
-		$_deferred = array_unique($_deferred);
+		$_deferred = array_unique( $_deferred );
 		foreach ( $_deferred as $i => $_post_id ) {
-			wp_update_comment_count_now($_post_id);
+			wp_update_comment_count_now( $_post_id );
 			unset( $_deferred[$i] ); /** @todo Move this outside of the foreach and reset $_deferred to an array instead */
 		}
 	}
@@ -2026,7 +2031,7 @@
 		return true;
 	}
 	elseif ( $post_id ) {
-		return wp_update_comment_count_now($post_id);
+		return wp_update_comment_count_now( $post_id );
 	}

 }
