Skip to:
Content

BuddyPress.org

Ticket #7683: 7683-business.diff

File 7683-business.diff, 656 bytes (added by boonebgorges, 7 years ago)
  • src/bp-friends/bp-friends-functions.php

    diff --git src/bp-friends/bp-friends-functions.php src/bp-friends/bp-friends-functions.php
    index ae2efb744..a57374a79 100644
    function friends_add_friend( $initiator_userid, $friend_userid, $force_accept = 
    4242                return true;
    4343        }
    4444
     45        $initiator_user = get_user_by( 'id', $initiator_userid );
     46        $friend_user    = get_user_by( 'id', $friend_userid );
     47        if ( ! $initiator_user || ! $friend_user ) {
     48                return false;
     49        }
     50
    4551        // Setup the friendship data.
    4652        $friendship = new BP_Friends_Friendship;
    4753        $friendship->initiator_user_id = (int) $initiator_userid;