@rayondigital/nest-dapr 0.9.12 → 0.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,9 +55,12 @@ class StatefulActor extends dapr_1.AbstractActor {
55
55
  if (typeof property.defaultValue === 'function') {
56
56
  this[property.key] = property.defaultValue();
57
57
  }
58
- else {
58
+ else if (property.defaultValue !== undefined) {
59
59
  this[property.key] = property.defaultValue;
60
60
  }
61
+ else {
62
+ this[property.key] = this.createInstance(property.type);
63
+ }
61
64
  }
62
65
  else {
63
66
  if (property.serializable) {
@@ -108,7 +111,12 @@ class StatefulActor extends dapr_1.AbstractActor {
108
111
  });
109
112
  }
110
113
  createInstance(type) {
111
- return new type();
114
+ try {
115
+ return new type();
116
+ }
117
+ catch (e) {
118
+ return undefined;
119
+ }
112
120
  }
113
121
  }
114
122
  exports.StatefulActor = StatefulActor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayondigital/nest-dapr",
3
- "version": "0.9.12",
3
+ "version": "0.9.13",
4
4
  "description": "Develop NestJs microservices using Dapr pubsub, actors and other bindings",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",