Skip to content

Commit

Permalink
Fix fatal when default_locale is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
msaggiorato authored Jul 29, 2024
1 parent d032938 commit 498d54e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/Generator/CustomerInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected static function get_country_locale_info( string $country_code = 'en_US
*/
protected static function get_faker( $country_code = 'en_US' ) {
$locale_info = self::get_country_locale_info( $country_code );
$default_locale = $locale_info['default_locale'] ?? 'en_US';
$default_locale = ! empty( $locale_info['default_locale'] ) ? $locale_info['default_locale'] : 'en_US';

$faker = \Faker\Factory::create( $default_locale );

Expand Down

0 comments on commit 498d54e

Please sign in to comment.