Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 18362)
+++ wp-includes/post.php	(working copy)
@@ -3172,6 +3172,9 @@
 	if ( empty($pages) )
 		return $null;
 
+	if ( 1 == count($pages) )
+		return get_page($pages[0]->ID, $output, $post_type);		
+
 	foreach ( $pages as $page ) {
 		$path = '/' . $leaf_path;
 		$curpage = $page;
@@ -3180,6 +3183,8 @@
 			$curpage = wp_cache_get( $post_parent, 'posts' );
 			if ( false === $curpage )
 				$curpage = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = %d and post_type = %s", $post_parent, $post_type ) );
+			if ( ! $curpage )
+				break;
 			$path = '/' . $curpage->post_name . $path;
 		}
 
