Skip to content

Commit 4c12518

Browse files
committed
fix: random word fails on undefined
1 parent ecfb8da commit 4c12518

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/random.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class Random {
326326
const randomWordMethod = this.faker.random.arrayElement(wordMethods);
327327

328328
result = randomWordMethod();
329-
} while (bannedChars.some((char) => result.includes(char)));
329+
} while (!result || bannedChars.some((char) => result.includes(char)));
330330

331331
return this.faker.random.arrayElement(result.split(' '));
332332
}

0 commit comments

Comments
 (0)