From 7ad9bd15ac201a6cb9779451c8fa095eec410f00 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Thu, 20 Jul 2017 16:18:41 -0400 Subject: [PATCH] Added a test that we can actually get user information before trying to access that data. --- models/admin/contacts/index.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) { -- 2.17.1