Skip to content

Commit 66284ab

Browse files
committed
tweak if statement
1 parent 64067ab commit 66284ab

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/execution/execute.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,16 +2294,11 @@ async function executeStreamAsyncIteratorItem(
22942294
let item;
22952295
try {
22962296
const iteration = await iterator.next();
2297-
if (!exeContext.streams.has(streamRecord.streamContext)) {
2297+
if (!exeContext.streams.has(streamRecord.streamContext) || iteration.done) {
22982298
streamRecord.setIsCompletedIterator();
22992299
return { done: true, value: undefined };
23002300
}
2301-
const { value, done } = iteration;
2302-
if (done) {
2303-
streamRecord.setIsCompletedIterator();
2304-
return { done, value: undefined };
2305-
}
2306-
item = value;
2301+
item = iteration.value;
23072302
} catch (rawError) {
23082303
handleFieldError(
23092304
rawError,

0 commit comments

Comments
 (0)