Skip to content

Commit

Permalink
Cleanup file if download fails
Browse files Browse the repository at this point in the history
  • Loading branch information
seear committed Nov 8, 2016
1 parent b8d517d commit c63ac18
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ protected static function download_wpcom_theme_to_file( $theme ) {

$response = $result[ 'response' ];
if ( $response[ 'code' ] !== 200 ) {
unlink( $file );
return new WP_Error( 'problem_fetching_theme', __( 'Problem downloading theme' ) );
}

Expand Down

0 comments on commit c63ac18

Please sign in to comment.