Custom post type thumbnail / Media Library WP_DEBUG notice [closed]

$data is not verified if it’s array, then workaround patch is as following.

media.php:535

foreach ( $imagedata['sizes'] as $_size => $data)
    {
        if ( is_array($data) ) {
      // already cropped to width or height; so use this size
            if ( ( $data['width'] == $size[0] && $data['height'] <= $size[1] ) || ( $data['height'] == $size[1] && $data['width'] <= $size[0] ) ) {
                     $file = $data['file'];
                                list($width, $height) = image_constrain_size_for_editor( $data['width'], $data['height'], $size );
                                return compact( 'file', 'width', 'height' );
                        }
                        // add to lookup table: area => size
                        $areas[$data['width'] * $data['height']] = $_size;
        }
    }