| @@ -715,9 +715,10 @@ | ||
| 715 | 715 | if ( $user instanceof Subscription ) { |
| 716 | 716 | return $user; |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | - $subscription = self::create( $user->user_login, $user->roles[0], $user->user_url, $user->display_name, $user->get_avatar_url(), $user->description, $user->user_registered ); | |
| 719 | + $role = isset( $user->roles[0] ) ? $user->roles[0] : 'subscription'; | |
| 720 | + $subscription = self::create( $user->user_login, $role, $user->user_url, $user->display_name, $user->get_avatar_url(), $user->description, $user->user_registered ); | |
| 720 | 721 | |
| 721 | 722 | if ( is_wp_error( $subscription ) ) { |
| 722 | 723 | return $subscription; |
| 723 | 724 | } |