diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 09e5d81e6c..e3a912ac81 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -1132,7 +1132,7 @@ function get_media_item( $attachment_id, $args = null ) {
$media_dims = apply_filters( 'media_meta', $media_dims, $post );
$image_edit_button = '';
- if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
+ if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
$nonce = wp_create_nonce( "image_editor-$post->ID" );
$image_edit_button = " ";
}
@@ -2270,7 +2270,7 @@ function edit_form_image_editor() {
$att_url = wp_get_attachment_url( $post->ID );
$image_edit_button = '';
- if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
+ if ( wp_attachment_is_image( $post->ID ) && wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
$nonce = wp_create_nonce( "image_editor-$post->ID" );
$image_edit_button = " ";
}