Skip to content

Commit fe82510

Browse files
authored
Update Chat.php
1 parent 4d103b5 commit fe82510

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Chat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function completions(array $data, array $options)
3535
'progress' => function ($buffer) use ($options) {
3636
static $tmp = '';
3737
$tmp .= $buffer;
38-
if ($tmp[strlen($tmp) - 1] !== "\n") {
38+
if ($tmp === '' || $tmp[strlen($tmp) - 1] !== "\n") {
3939
return null;
4040
}
4141
preg_match_all('/data: (\{.+?\})\n/', $tmp, $matches);

0 commit comments

Comments
 (0)