Browse Source

Merge pull request #8969 from aWeirdo/patch-35

Update decorators.ts
David Catuhe 5 years ago
parent
commit
3017a78bb2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Misc/decorators.ts

+ 2 - 2
src/Misc/decorators.ts

@@ -275,7 +275,7 @@ export class SerializationHelper {
             var propertyType = propertyDescriptor.type;
             var sourceProperty = (<any>entity)[property];
 
-            if (sourceProperty !== undefined && sourceProperty !== null) {
+            if (sourceProperty !== undefined && sourceProperty !== null && property !== "uniqueId") {
                 switch (propertyType) {
                     case 0:     // Value
                         serializationObject[targetPropertyName] = sourceProperty;
@@ -350,7 +350,7 @@ export class SerializationHelper {
             var sourceProperty = source[propertyDescriptor.sourceName || property];
             var propertyType = propertyDescriptor.type;
 
-            if (sourceProperty !== undefined && sourceProperty !== null) {
+            if (sourceProperty !== undefined && sourceProperty !== null && property !== "uniqueId") {
                 var dest = <any>destination;
                 switch (propertyType) {
                     case 0:     // Value