fix(editor): Fix chat crashing when rendering output-parsed content (#11210)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions

This commit is contained in:
oleg 2024-10-11 09:47:10 +02:00 committed by GitHub
parent 1078fa662a
commit 4aaebfd435
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -384,7 +384,12 @@ function extractResponseMessage(responseData?: IDataObject) {
if (!matchedPath) return JSON.stringify(responseData, null, 2);
return get(responseData, matchedPath) as string;
const matchedOutput = get(responseData, matchedPath);
if (typeof matchedOutput === 'object') {
return '```json\n' + JSON.stringify(matchedOutput, null, 2) + '\n```';
}
return matchedOutput?.toString() ?? '';
}
async function sendMessage(message: string, files?: File[]) {