From 4a03a94051015ce055a0d548c773c22129420c08 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 20 Sep 2007 18:25:14 +0000 Subject: [PATCH] Bail if post is empty. Props mdawaffe. fixes #5019 git-svn-id: http://svn.automattic.com/wordpress/trunk@6142 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index f01f59433..38d896087 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -358,7 +358,7 @@ function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) { function get_previous_post($in_same_cat = false, $excluded_categories = '') { global $post, $wpdb; - if( !is_single() || is_attachment() ) + if( empty($post) || !is_single() || is_attachment() ) return null; $current_post_date = $post->post_date; @@ -391,7 +391,7 @@ function get_previous_post($in_same_cat = false, $excluded_categories = '') { function get_next_post($in_same_cat = false, $excluded_categories = '') { global $post, $wpdb; - if( !is_single() || is_attachment() ) + if( empty($post) || !is_single() || is_attachment() ) return null; $current_post_date = $post->post_date;