diff --git a/wp-includes/post.php b/wp-includes/post.php index b13942002a..7073328c0d 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -6162,7 +6162,7 @@ function wp_delete_attachment( $post_id, $force_delete = false ) { $backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true ); $file = get_attached_file( $post_id ); - if ( is_multisite() ) { + if ( is_multisite() && is_string( $file ) && ! empty( $file ) ) { clean_dirsize_cache( $file ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 7c05884485..7c7da6bdf0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51911'; +$wp_version = '5.9-alpha-51912'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.