Index: wp-admin/includes/media.php
===================================================================
--- wp-admin/includes/media.php	(revision 18302)
+++ wp-admin/includes/media.php	(working copy)
@@ -1192,8 +1192,13 @@
 		$thumb_url = false;
 
 	$post = get_post( $attachment_id );
+	$calling_post_id = 0;
+	if ( isset( $_GET['post_id'] ) )
+		$calling_post_id = absint( $_GET['post_id'] );
+	elseif ( ! empty( $_POST ) ) // Like for async-upload where $_GET['post_id'] isn't set
+		$calling_post_id = $post->post_parent;
 
-	$default_args = array( 'errors' => null, 'send' => $post->post_parent ? post_type_supports( get_post_type( $post->post_parent ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true );
+	$default_args = array( 'errors' => null, 'send' => $calling_post_id ? post_type_supports( get_post_type( $calling_post_id ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true );
 	$args = wp_parse_args( $args, $default_args );
 	$args = apply_filters( 'get_media_item_args', $args );
 	extract( $args, EXTR_SKIP );
@@ -1315,11 +1320,6 @@
 	}
 
 	$thumbnail = '';
-	$calling_post_id = 0;
-	if ( isset( $_GET['post_id'] ) )
-		$calling_post_id = absint( $_GET['post_id'] );
-	elseif ( isset( $_POST ) && count( $_POST ) ) // Like for async-upload where $_GET['post_id'] isn't set
-		$calling_post_id = $post->post_parent;
 	if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
 		$ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
 		$thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html__( "Use as featured image" ) . "</a>";
