From: Chuck Scott Date: Thu, 20 Jul 2017 20:18:41 +0000 (-0400) Subject: Added a test that we can actually get user information before trying to access that... X-Git-Tag: v1.1.1^2~3 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=7ad9bd15ac201a6cb9779451c8fa095eec410f00;p=WP-Plugins%2Fglm-member-db-contacts.git Added a test that we can actually get user information before trying to access that data. --- diff --git a/models/admin/contacts/index.php b/models/admin/contacts/index.php index bc4fb4a..45cc4bd 100644 --- a/models/admin/contacts/index.php +++ b/models/admin/contacts/index.php @@ -725,12 +725,15 @@ class GlmMembersAdmin_contacts_index extends GlmDataContacts { // Attempt to get WordPress user data + $wpUserID = false; $contactCheck = $this->checkContact($contactInfo['fieldData']['email']); - $wpUser = new WP_User($contactCheck['wpUserEmail']->ID); - $wpUserID = $wpUser->ID; + if ($contactCheck['wpUserEmail']) { + $wpUser = new WP_User($contactCheck['wpUserEmail']->ID); + $wpUserID = $wpUser->ID; + } $contactMembersList = ''; - + // If we have a valid WordPress user ID if ($wpUserID) {