remove redundant invariant

This commit is contained in:
dwelle 2025-03-23 17:47:15 +01:00
parent bdbddb3c88
commit cc4f5665aa

View file

@ -12,7 +12,6 @@ import {
castArray, castArray,
findLastIndex, findLastIndex,
getUpdatedTimestamp, getUpdatedTimestamp,
invariant,
isTestEnv, isTestEnv,
} from "../utils"; } from "../utils";
@ -241,8 +240,6 @@ export const duplicateElements = (
index: number, index: number,
elements: ExcalidrawElement | null | ExcalidrawElement[], elements: ExcalidrawElement | null | ExcalidrawElement[],
) => { ) => {
invariant(index >= 0, "targetIndex must be >= 0");
if (!elements) { if (!elements) {
return; return;
} }