mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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
This commit is contained in:
parent
34d0f347ad
commit
5744245cc3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user