Object details: Fix "Call to a member function GetMainColor() on null"

This commit is contained in:
Molkobain
2021-03-05 09:49:46 +01:00
parent 1eae57a401
commit 642bb8b131

View File

@@ -61,10 +61,9 @@ class ObjectDetails extends Panel
$this->sObjectName = $oObject->GetRawName();
$this->sObjectMode = $sMode;
$oStyle = MetaModel::GetClassStyle($this->sClassName);
$sPanelColor = empty($oStyle->GetMainColor()) ? static::DEFAULT_COLOR : $oStyle->GetMainColor();
parent::__construct($this->sObjectName, [], $sPanelColor, $sId);
parent::__construct($this->sObjectName, [], static::DEFAULT_COLOR, $sId);
$this->SetColorFromClass($this->sClassName);
$this->ComputeIconUrl($oObject);
$this->ComputeState($oObject);
}