Skip to content

Commit edbdfdd

Browse files
CopilotOskarStark
andcommitted
Improve content type check to avoid string iteration
Co-authored-by: OskarStark <995707+OskarStark@users.noreply.github.com>
1 parent 74f8a8a commit edbdfdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/agent/src/Toolbox/StreamResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getContent(): \Generator
3939
}
4040

4141
$content = $innerResult->getContent();
42-
if (is_iterable($content)) {
42+
if ($content instanceof \Generator || $content instanceof \Iterator || (is_array($content))) {
4343
yield from $content;
4444
} else {
4545
yield $content;

0 commit comments

Comments
 (0)