Skip to content

Commit

Permalink
fix: add null property guards
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw committed Jun 28, 2018
1 parent 953c850 commit 0222da2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Expand Up @@ -34,8 +34,8 @@ class Node extends EventEmitter {
this.peerInfo = _options.peerInfo
this.peerBook = _options.peerBook || new PeerBook()

this._modules = _options.modules
this._config = _options.config
this._modules = _options.modules || {}
this._config = _options.config || {}
this._isStarted = false
this._transport = [] // Transport instances/references
this._discovery = [] // Discovery service instances/references
Expand Down Expand Up @@ -76,7 +76,7 @@ class Node extends EventEmitter {
}

// dht provided components (peerRouting, contentRouting, dht)
if (this._config.EXPERIMENTAL.dht) {
if (this._config.EXPERIMENTAL && this._config.EXPERIMENTAL.dht) {
const DHT = this._modules.dht
this._dht = new DHT(this._switch, {
kBucketSize: this._config.dht.kBucketSize || 20,
Expand Down

0 comments on commit 0222da2

Please sign in to comment.