checker thinks this could be undefined, handle it

This commit is contained in:
RealBeepMcJeep 2023-08-30 07:43:38 -07:00
parent c703b0b25e
commit 6bd77bac7a
1 changed files with 1 additions and 0 deletions

View File

@ -4375,6 +4375,7 @@ app.post('/horde_generateimage', jsonParser, async (request, response) => {
if (check.done) {
const result = await ai_horde.getImageGenerationStatus(generation.id);
if (result.generations === undefined) return response.sendStatus(500);
return response.send(result.generations[0].img);
}