From 1333b4dc982529ba76903b753833374717316f7a Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Tue, 19 Nov 2024 00:32:47 +0000 Subject: [PATCH] [XAM] Correct error code in XamUserGetGamerTag --- src/xenia/kernel/xam/xam_user.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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());