@nxtedition/deepstream.io-client-js 32.0.5 → 32.0.6

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": "@nxtedition/deepstream.io-client-js",
3
- "version": "32.0.5",
3
+ "version": "32.0.6",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "type": "module",
@@ -598,34 +598,38 @@ class Record {
598
598
  throw new Error('cannot reenter emitUpdate')
599
599
  }
600
600
 
601
- try {
602
- const arr = this._subscriptions
603
- const len = arr.length
604
-
605
- this._emittingArr = arr
606
- for (let n = 0; n < len; n += 2) {
607
- this._emittingIndex = n
608
- // TODO (fix): What if this throws?
609
- arr[n + 0](this, arr[n + 1])
601
+ if (this._subscriptions != null) {
602
+ try {
603
+ const arr = this._subscriptions
604
+ const len = arr.length
605
+
606
+ this._emittingArr = arr
607
+ for (let n = 0; n < len; n += 2) {
608
+ this._emittingIndex = n
609
+ // TODO (fix): What if this throws?
610
+ arr[n + 0](this, arr[n + 1])
611
+ }
612
+ } finally {
613
+ this._emittingArr = null
614
+ this._emittingIndex = -1
610
615
  }
611
- } finally {
612
- this._emittingArr = null
613
- this._emittingIndex = -1
614
616
  }
615
617
 
616
- try {
617
- const arr = this._observers
618
- const len = arr.length
619
-
620
- this._emittingArr = arr
621
- for (let n = 0; n < len; n++) {
622
- this._emittingIndex = n
623
- // TODO (fix): What if this throws?
624
- arr[n].onUpdate(this, arr[n])
618
+ if (this._observers != null) {
619
+ try {
620
+ const arr = this._observers
621
+ const len = arr.length
622
+
623
+ this._emittingArr = arr
624
+ for (let n = 0; n < len; n++) {
625
+ this._emittingIndex = n
626
+ // TODO (fix): What if this throws?
627
+ arr[n].onUpdate(this, arr[n])
628
+ }
629
+ } finally {
630
+ this._emittingArr = null
631
+ this._emittingIndex = -1
625
632
  }
626
- } finally {
627
- this._emittingArr = null
628
- this._emittingIndex = -1
629
633
  }
630
634
 
631
635
  this._handler._client.emit('recordUpdated', this)