Permalink
Browse files

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

git-svn-id: http://svn.automattic.com/wordpress/trunk@6142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 3542e01 commit 4a03a94051015ce055a0d548c773c22129420c08 ryan committed Sep 20, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 wp-includes/link-template.php
View
4 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;

0 comments on commit 4a03a94

Please sign in to comment.