Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 21842)
+++ wp-includes/post.php	(working copy)
@@ -3442,7 +3442,8 @@
 	$uri = $page->post_name;
 
 	foreach ( $page->ancestors as $parent ) {
-		$uri = get_post( $parent )->post_name . "/" . $uri;
+		if ( $parent = get_post( $parent ) )
+			$uri = $parent->post_name . '/' . $uri;
 	}
 
 	return $uri;
