Bail if post is empty. Props mdawaffe. fixes #5019

git-svn-id: https://develop.svn.wordpress.org/trunk@6142 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-09-20 18:25:14 +00:00
parent 59a07b76a9
commit 759c182911
1 changed files with 2 additions and 2 deletions

View File

@ -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;