Title: Error when selecting user to switch
Last modified: July 10, 2024

---

# Error when selecting user to switch

 *  Resolved [sagejohn](https://wordpress.org/support/users/sagejohn/)
 * (@sagejohn)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/error-when-selecting-user-to-switch/)
 *     ```wp-block-code
       WordPress version 6.4.4Active theme: Terra Hub Theme (version 1.4.8)Current plugin: WPFront User Role Editor (version 4.1.1)PHP version 8.1.29Error Details=============An error of type E_ERROR was caused in line 530 of the file /usr/www/users/terrarksrd/wp-content/plugins/wpfront-user-role-editor/includes/users/class-user-switching.php. Error message: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in /usr/www/users/terrarksrd/wp-content/plugins/wpfront-user-role-editor/includes/users/class-user-switching.php:530Stack trace:#0 /usr/www/users/terrarksrd/wp-content/plugins/wpfront-user-role-editor/includes/users/class-user-switching.php(530): method_exists(NULL, 'forget_session')#1 /usr/www/users/terrarksrd/wp-content/plugins/wpfront-user-role-editor/includes/users/class-user-switching.php(244): WPFront\URE\User_Switching\WPFront_User_Role_Editor_User_Switching->forget_woocommerce_session()#2 /usr/www/users/terrarksrd/wp-includes/class-wp-hook.php(324): WPFront\URE\User_Switching\WPFront_User_Role_Editor_User_Switching->switch_user('')#3 /usr/www/users/terrarksrd/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)#4 /usr/www/users/terrarksrd/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#5 /usr/www/users/terrarksrd/wp-settings.php(643): do_action('init')#6 /usr/www/users/terrarksrd/wp-config.php(108): require_once('/usr/www/users/...')#7 /usr/www/users/terrarksrd/wp-load.php(50): require_once('/usr/www/users/...')#8 /usr/www/users/terrarksrd/wp-admin/admin.php(34): require_once('/usr/www/users/...')#9 /usr/www/users/terrarksrd/wp-admin/users.php(11): require_once('/usr/www/users/...')#10 {main}  thrown
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [1 year, 11 months ago](https://wordpress.org/support/topic/error-when-selecting-user-to-switch/#post-17881524)
 * You’ll need to report this to the author of the `wpfront-user-role-editor` plugin.
   Thanks.

Viewing 1 replies (of 1 total)

The topic ‘Error when selecting user to switch’ is closed to new replies.

 * ![](https://ps.w.org/user-switching/assets/icon.svg?rev=3193956)
 * [User Switching](https://wordpress.org/plugins/user-switching/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-switching/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-switching/)
 * [Active Topics](https://wordpress.org/support/plugin/user-switching/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-switching/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-switching/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/error-when-selecting-user-to-switch/#post-17881524)
 * Status: resolved