Enhance callback handling in SocketUser class to ensure callback is a function before invocation, preventing potential runtime errors.
This commit is contained in:
parent
0748256ce8
commit
7002e5a6c1
@ -174,7 +174,9 @@ export class SocketUser {
|
|||||||
data.objectType,
|
data.objectType,
|
||||||
data.filter
|
data.filter
|
||||||
);
|
);
|
||||||
callback({ success: true });
|
if (typeof callback === 'function') {
|
||||||
|
callback({ success: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleSubscribeToObjectUpdateEvent(data, callback) {
|
async handleSubscribeToObjectUpdateEvent(data, callback) {
|
||||||
@ -182,7 +184,9 @@ export class SocketUser {
|
|||||||
data._id,
|
data._id,
|
||||||
data.objectType
|
data.objectType
|
||||||
);
|
);
|
||||||
callback(result);
|
if (typeof callback === 'function') {
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleSubscribeToObjectEventEvent(data) {
|
async handleSubscribeToObjectEventEvent(data) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user