• Resolved anhduc.bkhn

    (@anhducbkhn)


    My env:

    WP: 6.1
    MWB HubSpot for WooCommerce: 1.4.5

    Plugin try to access the role of an user, but in some case, role is an empty array.

    <?php
    // File makewebbetter-hubspot-for-woocommerce/includes/class-hubwoodatasync.php line 348
    $user_data = get_user_by( 'email', $email );
    $role      = $user_data->roles[0];

    We should check if role is empty or not before access

    <?php
    $user_data = get_user_by( 'email', $email );
    
    if (empty($user_data->roles)) {
        continue;
    }
    
    $role      = $user_data->roles[0];
Viewing 1 replies (of 1 total)
  • Plugin Author MakeWebBetter

    (@makewebbetter)

    Hello,

    Thank you for your suggestion, we are already sending those contacts to a function who has a user role, but we’ll review it further and surely consider your point.

    Thanks,

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin try to access an empty array at makewebbetter-hubspot-for-woocommerce/inc’ is closed to new replies.