From fb1b87e2249798c6257cb5383f73a15022f438f0 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Mon, 4 Apr 2022 17:01:18 +0200 Subject: fix: random word fails on undefined (#771) --- src/random.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/random.ts b/src/random.ts index a653472f..448cf4f8 100644 --- a/src/random.ts +++ b/src/random.ts @@ -326,7 +326,7 @@ export class Random { const randomWordMethod = this.faker.random.arrayElement(wordMethods); result = randomWordMethod(); - } while (bannedChars.some((char) => result.includes(char))); + } while (!result || bannedChars.some((char) => result.includes(char))); return this.faker.random.arrayElement(result.split(' ')); } -- cgit v1.2.3