diff --git a/frontend/src/ts/test/wikipedia.ts b/frontend/src/ts/test/wikipedia.ts index af890e5a1c2d..4519d06641eb 100644 --- a/frontend/src/ts/test/wikipedia.ts +++ b/frontend/src/ts/test/wikipedia.ts @@ -100,6 +100,12 @@ export async function getSection( // Removing whitespace before and after text sectionText = sectionText.trim(); + // If this section is empty, fetch another one + if (sectionText === "") { + res(getSection(language)); + return; + } + const words = sectionText.split(" "); const section = new JSONData.Section(