Fix pubsub error handling

This commit is contained in:
haad 2016-05-12 15:00:48 +02:00
parent 7a8210cea8
commit 175ec1ba0d

View File

@ -130,7 +130,7 @@ class OrbitDB {
logger.warn("Couldn't connect to Pubsub: " + e.message);
if(!allowOffline) {
logger.debug("'allowOffline' set to false, terminating");
this._pubsub.disconnect();
if(this._pubsub) this._pubsub.disconnect();
throw e;
}
this.user = { username: username, id: username } // TODO: user id from ipfs hash