Index: wp-includes/link-template.php
===================================================================
--- wp-includes/link-template.php	(revision 5954)
+++ wp-includes/link-template.php	(working copy)
@@ -60,6 +60,9 @@
 	);
 
 	$post = &get_post($id);
+
+	if ( empty($post->ID) ) return FALSE;
+
 	if ( $post->post_type == 'page' )
 		return get_page_link($post->ID);
 	elseif ($post->post_type == 'attachment')
