Skip to content
Snippets Groups Projects
Commit cd47af8a authored by Lioncash's avatar Lioncash
Browse files

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.
parent e1ea8cc7
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment