From 5744245cc3c4ee860985c957bf2bb6f8ba1ea408 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 25 Jun 2013 14:24:18 +0000 Subject: [PATCH] Avoid a fatal error when adding a non-existent user to a site. props duck_. fixes #24460. git-svn-id: http://core.svn.wordpress.org/trunk@24509 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/network/site-users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/network/site-users.php b/wp-admin/network/site-users.php index 0812b50c56..0c7a1c7296 100644 --- a/wp-admin/network/site-users.php +++ b/wp-admin/network/site-users.php @@ -86,7 +86,7 @@ if ( $action ) { $update = 'adduser'; $newuser = $_POST['newuser']; $user = get_user_by( 'login', $newuser ); - if ( $user->exists() ) { + if ( $user && $user->exists() ) { if ( ! is_user_member_of_blog( $user->ID, $id ) ) add_user_to_blog( $id, $user->ID, $_POST['new_role'] ); else