diff options
author | Lioncash <mathew1800@gmail.com> | 2018-11-14 17:40:47 -0500 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-11-14 17:43:23 -0500 |
commit | cd47af8af03e4a52b1dd6a955cac9b814aa3de71 (patch) | |
tree | 398d533258ca1aca3433677ce1e8ff7eb9b9f2bf | |
parent | e1ea8cc7214be591067959a3697ed53e95007ac2 (diff) |
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.
-rw-r--r-- | src/core/hle/service/acc/acc.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<u128>(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<u128>(INVALID_UUID); return; |