Skip to content

Commit 52cd63e

Browse files
committed
fix error when no campaign
1 parent 8a23557 commit 52cd63e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

admin/class-hello-asso-admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function wporg_custom_box_html($post) {
297297
$pageWidget = "ha-no-sync";
298298
$type = "error_1";
299299
} else {
300-
$campaign = get_option('ha-campaign');
300+
$campaign = get_option('ha-campaign') ?? [];
301301
$nbCampaign = count($campaign);
302302
if (($nbCampaign == 0 or $campaign == '') && get_option('ha-error') == 0) {
303303
$pageWidget = "ha-no-campaign";
@@ -362,7 +362,7 @@ class="st38"/>
362362
<div id="ha-dropdown" class="ha-dropdown-content">
363363
<a href="<?= esc_url(admin_url()); ?>admin.php?page=hello-asso">Synchronisation</a>
364364
<?php
365-
$campaign = get_option('ha-campaign');
365+
$campaign = get_option('ha-campaign') ?? [];
366366
$nbCampaign = count($campaign);
367367

368368
if (get_option('ha-slug') == '') {

0 commit comments

Comments
 (0)