diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index e51d7618e..5073f6b37 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -141,18 +141,18 @@ DECLARE_XAM_EXPORT1(XamUserGetName, kUserProfiles, kImplemented); dword_result_t XamUserGetGamerTag_entry(dword_t user_index, lpu16string_t buffer, dword_t buffer_len) { - if (user_index >= XUserMaxUserCount) { - return X_E_INVALIDARG; - } - if (!buffer || buffer_len < 16) { return X_E_INVALIDARG; } - if (!kernel_state()->xam_state()->IsUserSignedIn(user_index)) { + if (user_index >= XUserMaxUserCount) { return X_E_INVALIDARG; } + if (!kernel_state()->xam_state()->IsUserSignedIn(user_index)) { + return X_ERROR_NO_SUCH_USER; + } + const auto& user_profile = kernel_state()->xam_state()->GetUserProfile(user_index); auto user_name = xe::to_utf16(user_profile->name());