mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2847 - Fix crash when object with state attribute has no state defined
This commit is contained in:
@@ -10,11 +10,11 @@ namespace Combodo\iTop\Application\UI\Helper;
|
||||
|
||||
use MetaModel;
|
||||
|
||||
// TODO 3.0.0: Delete this class as it is only a temporary helper while code is being reworked.
|
||||
class UIHelper
|
||||
{
|
||||
public static function GetColorFromStatus(string $sClass, string $sStateCode)
|
||||
public static function GetColorFromStatus(string $sClass, ?string $sStateCode): string
|
||||
{
|
||||
$sStatusColor = 'neutral';
|
||||
$sRootClass = MetaModel::GetRootClass($sClass);
|
||||
switch ($sRootClass) {
|
||||
case 'Ticket':
|
||||
|
||||
Reference in New Issue
Block a user