diff --git a/wp-login.php b/wp-login.php
index e4153e2562..7fcf9d663a 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -353,7 +353,7 @@ function register_new_user( $user_login, $user_email ) {
$user_pass = wp_generate_password( 12, false);
$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
- if ( ! $user_id ) {
+ if ( ! $user_id || is_wp_error( $user_id ) ) {
$errors->add( 'registerfail', sprintf( __( 'ERROR: Couldn’t register you… please contact the webmaster !' ), get_option( 'admin_email' ) ) );
return $errors;
}