Skip to content

Commit

Permalink
fix(AsyncQueue): call the callback only if it's defined (jitsi#2370)
Browse files Browse the repository at this point in the history
  • Loading branch information
athouary authored and subhamcyara committed Jul 19, 2024
1 parent cc462d1 commit 5b8aa06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/util/AsyncQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class AsyncQueue {
clear() {
for (const finishedCallback of this._taskCallbacks.values()) {
try {
finishedCallback(new ClearedQueueError('The queue has been cleared'));
finishedCallback?.(new ClearedQueueError('The queue has been cleared'));
} catch (error) {
logger.error('Error in callback while clearing the queue:', error);
}
Expand Down

0 comments on commit 5b8aa06

Please sign in to comment.