N°1644 Fix PHP 7.2 compatibility issue (count() on none array)

This commit is contained in:
Molkobain
2018-10-02 14:57:51 +02:00
parent 6e50a1c4be
commit 12e9e453d8

View File

@@ -2494,7 +2494,7 @@ EOF
else
{
$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, $aArgs);
if (count($aAllowedValues) == 1)
if (is_array($aAllowedValues) && count($aAllowedValues) == 1)
{
$aValues = array_keys($aAllowedValues);
$this->Set($sAttCode, $aValues[0]);