Added a test that we can actually get user information before trying to access that...
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 20 Jul 2017 20:18:41 +0000 (16:18 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 20 Jul 2017 20:18:41 +0000 (16:18 -0400)
models/admin/contacts/index.php

index bc4fb4a..45cc4bd 100644 (file)
@@ -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) {