From 3ee2eed974be52e6efb2cebde451a5979776f5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=B0=D1=80=D0=B0=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC?= Date: Mon, 10 Aug 2020 09:27:23 +0300 Subject: [PATCH] Add selection of client roles: fix undefined prop error --- src/include/class-wc-retailcrm-customers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/class-wc-retailcrm-customers.php b/src/include/class-wc-retailcrm-customers.php index 9e76a92..8592810 100644 --- a/src/include/class-wc-retailcrm-customers.php +++ b/src/include/class-wc-retailcrm-customers.php @@ -637,7 +637,7 @@ if (!class_exists('WC_Retailcrm_Customers')) : $userRoles = $user->roles; } elseif ($user instanceof WC_Customer) { $wpUser = get_user_by('id', $user->get_id()); - $userRoles = $wpUser->roles; + $userRoles = ($wpUser) ? $wpUser->roles : array($user->get_role()); } else { return false; }