Add selection of client roles: fix undefined prop error
This commit is contained in:
parent
3db915637b
commit
3ee2eed974
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue