diff --git a/packages/plots/src/core/constants/index.ts b/packages/plots/src/core/constants/index.ts index 3a7fe1b26..e5f7bae70 100644 --- a/packages/plots/src/core/constants/index.ts +++ b/packages/plots/src/core/constants/index.ts @@ -252,10 +252,10 @@ export const SPECIAL_OPTIONS = [ if (available) { origin[key].push({ [TRANSFORM_SIGN]: true, ...rest }); } else { - origin[key].splice( - origin[key].indexOf((item) => item.type === value.type), - 1, - ); + const index = origin[key].indexOf((item) => item.type === value.type); + if (index !== -1) { + origin[key].splice(index, 1); + } } }, },