Skip to content
Snippets Groups Projects
Commit 63eb34cf authored by Jakob P's avatar Jakob P
Browse files

Issue #3353389 by japerry: TypeError: Argument 1 passed to...

Issue #3353389 by japerry: TypeError: Argument 1 passed to Drupal\google_analytics\GaAccount::__construct() must be of the type string, null given
parent 302b637e
No related branches found
No related tags found
1 merge request!42Accounts is set as an empty array already, don't try to fill it with an empty account.
Pipeline #370387 passed with warnings
......@@ -46,7 +46,10 @@ class GoogleAnalyticsAccounts {
$accounts = $this->config->get('account') ?? '';
// Create the accounts array from either a single gtag id or multiple ones.
if (strpos($accounts, ',') === FALSE) {
$this->accounts[] = new GaAccount($accounts);
// Only fill the accounts array if an account exists in config.
if ($accounts !== '') {
$this->accounts[] = new GaAccount($accounts);
}
}
else {
$accounts_array = explode(',', $accounts ?? '');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment