Skip to content

Commit 3a0cf84

Browse files
authored
Fix Queue dropping falsy items (#1190)
1 parent 5b5ba2c commit 3a0cf84

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/rare-dryers-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/agents": patch
3+
---
4+
5+
Fix Queue dropping falsy items

agents/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class Queue<T> {
101101
await once(this.#events, 'put');
102102
}
103103
let item = this.items.shift();
104-
if (!item) {
104+
if (typeof item === 'undefined') {
105105
item = await _get();
106106
}
107107
return item;

0 commit comments

Comments
 (0)