diff --git a/project/src/utils/cloners/RecursiveCloner.ts b/project/src/utils/cloners/RecursiveCloner.ts index 751c781f..16a7a164 100644 --- a/project/src/utils/cloners/RecursiveCloner.ts +++ b/project/src/utils/cloners/RecursiveCloner.ts @@ -35,6 +35,14 @@ export class RecursiveCloner implements ICloner const newObj = {}; for (const propOf1 in obj) { + // If the value of the original property is null, ensure the cloned value is also null + // This fixes an issue where null arrays were incorrectly being converted to empty objects + if (obj[propOf1] === null) + { + newObj[propOf1.toString()] = null; + continue; + } + newObj[propOf1.toString()] = this.clone(obj[propOf1]); } return newObj as T;