attlaz-client 1.10.3 → 1.10.5

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.
@@ -80,6 +80,9 @@ export class Endpoint {
80
80
  /**
81
81
  * Parse data
82
82
  */
83
+ if (!requestResponse === null || requestResponse === undefined) {
84
+ throw new Error('Unable to parse collection: response is empty');
85
+ }
83
86
  if (!requestResponse.hasOwnProperty('data') || requestResponse.data === undefined) {
84
87
  throw new Error('Unable to parse collection: data is not defined');
85
88
  }
@@ -100,6 +103,9 @@ export class Endpoint {
100
103
  * Parse errors
101
104
  */
102
105
  // TODO: temporary check until we know the API is fully upgraded
106
+ if (!requestResponse === null || requestResponse === undefined) {
107
+ throw new Error('Unable to parse object');
108
+ }
103
109
  if ((requestResponse.hasOwnProperty('data') && !requestResponse.hasOwnProperty('id')) && requestResponse.data !== undefined) {
104
110
  console.error('Response for object "' + action + '" seem to still use old "data" property', { requestResponse });
105
111
  requestResponse = requestResponse.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.10.3",
3
+ "version": "1.10.5",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",