aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/random.ts2
1 files changed, 1 insertions, 1 deletions
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(' '));
}