Apply code review suggestions

This commit is contained in:
Stephen Abello
2026-09-16 14:53:34 +02:00
parent 040f74e3ae
commit 48b779533c

View File

@@ -1243,12 +1243,13 @@ JS
$oShortcutSearch->AddCondition('user_id', UserRights::GetUserId(), '=');
$oShortcutSearch->AddCondition('id', $iShortcut, '=');
$oShortcutSet = new CMDBObjectSet($oShortcutSearch);
if ($oShortcutSet->Count() === 0) {
throw new SecurityException(Dict::S('UI:ObjectDoesNotExist'));
}
$oShortcut = $oShortcutSet->Fetch();
if ($oShortcut === null) {
throw new SecurityException(Dict::S('UI:ObjectDoesNotExist'));
}
$oShortcut->StartRenameDialog($oPage);
break;
@@ -1259,12 +1260,12 @@ JS
$oShortcutSearch->AddCondition('user_id', UserRights::GetUserId(), '=');
$oShortcutSearch->AddCondition('id', $iShortcut, '=');
$oShortcutSet = new CMDBObjectSet($oShortcutSearch);
if ($oShortcutSet->Count() === 0) {
$oShortcut = $oShortcutSet->Fetch();
if ($oShortcut === null) {
throw new SecurityException(Dict::S('UI:ObjectDoesNotExist'));
}
$oShortcut = $oShortcutSet->Fetch();
$sName = utils::ReadParam('attr_name', '', false, 'raw_data');
if (strlen($sName) > 0) {
$oShortcut->Set('name', $sName);