diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts index ef5a09483c67..f16b2e772a87 100644 --- a/src/libs/actions/Policy.ts +++ b/src/libs/actions/Policy.ts @@ -3114,7 +3114,7 @@ function clearPolicyTagErrors(policyID: string, tagName: string) { function renamePolicyTag(policyID: string, policyTag: {oldName: string; newName: string}) { const tagListName = Object.keys(allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`] ?? {})[0]; - const oldTag = allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`]?.[policyTag.oldName] ?? {}; + const oldTag = allPolicyTags?.[`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`]?.[tagListName]?.tags?.[policyTag.oldName] ?? {}; const onyxData: OnyxData = { optimisticData: [ {