mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
fix(package/addCommand): argument validation
Get the first index of raw.split for the command name. Check if value is defined (as 0 is falsey). Don't subscribe to 0-index propaganda (argument index+1).
This commit is contained in:
@@ -60,9 +60,9 @@ function parseArguments(
|
||||
break;
|
||||
}
|
||||
|
||||
if (!value && (!param.optional || (param.optional && arg))) {
|
||||
if (value === undefined && (!param.optional || (param.optional && arg))) {
|
||||
return Citizen.trace(
|
||||
`^1command '${raw.split(' ') || raw}' received an invalid ${param.paramType} for argument ${index} (${
|
||||
`^1command '${raw.split(' ')[0] || raw}' received an invalid ${param.paramType} for argument ${index + 1} (${
|
||||
param.name
|
||||
}), received '${arg}'^0`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user