diff options
| author | 2018-11-14 17:40:47 -0500 | |
|---|---|---|
| committer | 2018-11-14 17:43:23 -0500 | |
| commit | cd47af8af03e4a52b1dd6a955cac9b814aa3de71 (patch) | |
| tree | 398d533258ca1aca3433677ce1e8ff7eb9b9f2bf /src | |
| parent | Merge pull request #1679 from DarkLordZach/deterministic-rng-2 (diff) | |
| download | yuzu-cd47af8af03e4a52b1dd6a955cac9b814aa3de71.tar.gz yuzu-cd47af8af03e4a52b1dd6a955cac9b814aa3de71.tar.xz yuzu-cd47af8af03e4a52b1dd6a955cac9b814aa3de71.zip | |
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.
Diffstat (limited to 'src')
| -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 | |||
| 252 | rb.PushRaw<u128>(INVALID_UUID); | 252 | rb.PushRaw<u128>(INVALID_UUID); |
| 253 | return; | 253 | return; |
| 254 | } | 254 | } |
| 255 | auto user_list = profile_manager->GetAllUsers(); | 255 | |
| 256 | if (user_list.empty()) { | 256 | const auto user_list = profile_manager->GetAllUsers(); |
| 257 | if (std::all_of(user_list.begin(), user_list.end(), | ||
| 258 | [](const auto& user) { return user.uuid == INVALID_UUID; })) { | ||
| 257 | rb.Push(ResultCode(-1)); // TODO(ogniK): Find the correct error code | 259 | rb.Push(ResultCode(-1)); // TODO(ogniK): Find the correct error code |
| 258 | rb.PushRaw<u128>(INVALID_UUID); | 260 | rb.PushRaw<u128>(INVALID_UUID); |
| 259 | return; | 261 | return; |