From cd47af8af03e4a52b1dd6a955cac9b814aa3de71 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 14 Nov 2018 17:40:47 -0500 Subject: service/acc: Correct error case within TrySelectUserWithoutInteraction() empty() in this case will always return false, since the returned container is a std::array. Instead, check if all given users are invalid before returning the error code. --- src/core/hle/service/acc/acc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 8318eff5f..c629f9357 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -252,8 +252,10 @@ void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContex rb.PushRaw(INVALID_UUID); return; } - auto user_list = profile_manager->GetAllUsers(); - if (user_list.empty()) { + + const auto user_list = profile_manager->GetAllUsers(); + if (std::all_of(user_list.begin(), user_list.end(), + [](const auto& user) { return user.uuid == INVALID_UUID; })) { rb.Push(ResultCode(-1)); // TODO(ogniK): Find the correct error code rb.PushRaw(INVALID_UUID); return; -- cgit v1.2.3