mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
fix(package): added an array check on callback args (#85)
-> Issue is that if callaback returns a null value it errors and fails
This commit is contained in:
@@ -29,7 +29,7 @@ export function triggerClientCallback<T = unknown>(
|
||||
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
pendingCallbacks[key] = (args) => {
|
||||
if (args[0] === 'cb_invalid') reject(`callback '${eventName} does not exist`);
|
||||
if (Array.isArray(args) && args[0] === 'cb_invalid') reject(`callback '${eventName} does not exist`);
|
||||
|
||||
resolve(args);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user