From 759c1829110e82ed87c56ea9abdec0d3e535a6e4 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 20 Sep 2007 18:25:14 +0000 Subject: [PATCH] Bail if post is empty. Props mdawaffe. fixes #5019 git-svn-id: https://develop.svn.wordpress.org/trunk@6142 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 f01f594331..38d8960877 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;