Do not sent empty brand name

causes error
This commit is contained in:
Alex P. 2025-05-29 16:30:39 +03:00
parent b0ee2cfc6d
commit c19b89ed5b
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -77,8 +77,13 @@ class ExperienceContextBuilder {
public function with_current_brand_name(): ExperienceContextBuilder {
$builder = clone $this;
$brand_name = $this->settings->has( 'brand_name' ) ? (string) $this->settings->get( 'brand_name' ) : '';
if ( empty( $brand_name ) ) {
$brand_name = null;
}
$builder->experience_context = $builder->experience_context
->with_brand_name( $this->settings->has( 'brand_name' ) ? (string) $this->settings->get( 'brand_name' ) : '' );
->with_brand_name( $brand_name );
return $builder;
}