diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 14fa5b0cb17..77d24c891b5 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -904,7 +904,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
print '
';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '| ';
- $selectedfields = (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
+ $selectedfields = (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print $selectedfields;
print ' | ';
}