diff --git src/wp-includes/admin-bar.php src/wp-includes/admin-bar.php
index cd1bb82..ea1127e 100644
--- src/wp-includes/admin-bar.php
+++ src/wp-includes/admin-bar.php
@@ -530,12 +530,13 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
 		if ( ! empty( $current_object->post_type )
 			&& ( $post_type_object = get_post_type_object( $current_object->post_type ) )
 			&& current_user_can( 'edit_post', $current_object->ID )
-			&& $post_type_object->show_ui && $post_type_object->show_in_admin_bar )
+			&& $post_type_object->show_ui && $post_type_object->show_in_admin_bar
+			&& $edit_post_link = get_edit_post_link( $current_object->ID ) )
 		{
 			$wp_admin_bar->add_menu( array(
 				'id' => 'edit',
 				'title' => $post_type_object->labels->edit_item,
-				'href' => get_edit_post_link( $current_object->ID )
+				'href' => $edit_post_link
 			) );
 		} elseif ( ! empty( $current_object->taxonomy )
 			&& ( $tax = get_taxonomy( $current_object->taxonomy ) )
