@5minds/node-red-contrib-processcube 1.5.2-feature-fcaf4b-m3hagv0j → 1.5.2-feature-8f4ce8-m3igte5w

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.5.2-feature-fcaf4b-m3hagv0j",
3
+ "version": "1.5.2-feature-8f4ce8-m3igte5w",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
@@ -46,12 +46,16 @@ module.exports = function (RED) {
46
46
 
47
47
  node.url = newUrl;
48
48
  if (node.credentials.clientId && node.credentials.clientSecret) {
49
- this.engineClient.dispose();
49
+ if (this.engineClient) {
50
+ this.engineClient.dispose();
51
+ }
50
52
  node.engineClient = new engine_client.EngineClient(node.url, () =>
51
53
  getFreshIdentity(node.url, node)
52
54
  );
53
55
  } else {
54
- this.engineClient.dispose();
56
+ if (this.engineClient) {
57
+ this.engineClient.dispose();
58
+ }
55
59
  node.engineClient = new engine_client.EngineClient(node.url);
56
60
  }
57
61
  }
@@ -105,9 +109,7 @@ module.exports = function (RED) {
105
109
 
106
110
  return freshIdentity;
107
111
  } catch (e) {
108
- console.log('Could not get fresh identity', e);
109
- node.error('Could not get fresh identity');
110
- node.error(e);
112
+ node.error(`Could not get fresh identity: ${e}`);
111
113
  }
112
114
  }
113
115