From f30fc0e068de51c2cff31da081a4641e68e9ea8f Mon Sep 17 00:00:00 2001 From: Ashley Graves Date: Sat, 12 Oct 2024 00:41:07 +0200 Subject: [PATCH] feck --- src/commands/fun/gelbooru.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/fun/gelbooru.js b/src/commands/fun/gelbooru.js index 8ffe0b6..4e482ca 100644 --- a/src/commands/fun/gelbooru.js +++ b/src/commands/fun/gelbooru.js @@ -149,7 +149,7 @@ module.exports = { var tries = 0; var posts; - while (posts.length == 0 && (tries++) < 5) + while ((!posts || posts.length == 0) && (tries++) < 5) posts = await Booru.search(booru, searchTags, { limit: 1, random: true, credentials: credentials[booru] ?? null }); const post = posts[Math.floor(Math.random() * posts.length)];