File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change @@ -268,4 +268,19 @@ describe('system', () => {
268268 } ) ;
269269 }
270270 } ) ;
271+
272+ describe ( 'extra tests' , ( ) => {
273+ describe ( 'commonFileName()' , ( ) => {
274+ afterEach ( ( ) => {
275+ faker . locale = 'en' ;
276+ } ) ;
277+
278+ it ( '#770' , ( ) => {
279+ faker . seed ( 5423027051750305 ) ;
280+ faker . setLocale ( 'sk' ) ;
281+ faker . system . commonFileName ( 'xml' ) ;
282+ faker . system . commonFileName ( 'xml' ) ;
283+ } ) ;
284+ } ) ;
285+ } ) ;
271286} ) ;
You can’t perform that action at this time.
0 commit comments