Just to be safe

This commit is contained in:
igor725 2024-04-27 17:32:07 +03:00
parent 7fc4e044b3
commit 21e5e7529c
No known key found for this signature in database
GPG Key ID: 46F13BBE46F8569D

View File

@ -53,12 +53,14 @@ EXPORT SYSV_ABI int32_t sceUserServiceTerminate() {
}
EXPORT SYSV_ABI int sceUserServiceGetInitialUser(int* userId) {
if (userId == nullptr) return Err::UserService::INVALID_ARGUMENT;
auto [lock, jData] = accessConfig()->accessModule(ConfigModFlag::GENERAL);
if (!getJsonParam(jData, "userIndex", *userId) || (*userId < 1 || *userId > 3)) *userId = 1;
return Ok;
}
EXPORT SYSV_ABI int sceUserServiceGetEvent(UserServiceEvent* event) {
if (event == nullptr) return Err::UserService::INVALID_ARGUMENT;
auto [lock, jData] = accessConfig()->accessModule(ConfigModFlag::GENERAL);
int onlineUsers;
@ -75,6 +77,7 @@ EXPORT SYSV_ABI int sceUserServiceGetEvent(UserServiceEvent* event) {
}
EXPORT SYSV_ABI int sceUserServiceGetLoginUserIdList(UserServiceLoginUserIdList* userId_list) {
if (userId_list == nullptr) return Err::UserService::INVALID_ARGUMENT;
auto [lock, jData] = accessConfig()->accessModule(ConfigModFlag::GENERAL);
int onlineUsers;
@ -108,7 +111,7 @@ EXPORT SYSV_ABI int sceUserServiceGetUserName(int userId, char* name, size_t siz
}
EXPORT SYSV_ABI int32_t sceUserServiceGetUserColor(int userId, UserServiceUserColor* color) {
if (userId < 1 || userId > 3) return Err::UserService::INVALID_ARGUMENT;
if (userId < 1 || userId > 3 || color == nullptr) return Err::UserService::INVALID_ARGUMENT;
auto [lock, jData] = accessConfig()->accessModule(ConfigModFlag::GENERAL);
std::string _scolor;