mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix(sse): prevent errors by returning early if response data is undefined
This commit is contained in:
parent
69643f4e5b
commit
a8c8a3d8ff
@ -53,6 +53,7 @@ export const startMsgSSEStreamWithRetry: () => () => void = () => {
|
|||||||
responseType: 'stream',
|
responseType: 'stream',
|
||||||
adapter: 'fetch',
|
adapter: 'fetch',
|
||||||
});
|
});
|
||||||
|
if (!res?.data) return;
|
||||||
const stream = res.data;
|
const stream = res.data;
|
||||||
const reader = stream.pipeThrough(new TextDecoderStream()).getReader();
|
const reader = stream.pipeThrough(new TextDecoderStream()).getReader();
|
||||||
retryTimes = 0;
|
retryTimes = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user