ai: fix more null error

This commit is contained in:
end-4 2025-06-02 18:39:57 +02:00
parent 2c113018d2
commit 0fba075f52

View file

@ -487,6 +487,8 @@ Singleton {
try {
if (requester.geminiBuffer.length === 0) return;
const dataJson = JSON.parse(requester.geminiBuffer);
if (!dataJson.candidates) return;
if (dataJson.candidates[0]?.finishReason) {
requester.markDone();
}