YUKI Hiroshi
null+****@clear*****
Thu Oct 30 11:44:33 JST 2014
YUKI Hiroshi 2014-10-30 11:44:33 +0900 (Thu, 30 Oct 2014) New Revision: 729b06d569c1c243d57cc34eed86a5fc89ea0ab0 https://github.com/droonga/express-droonga/commit/729b06d569c1c243d57cc34eed86a5fc89ea0ab0 Message: Don't raise errors from nonexistent attributes Modified files: lib/catalog/v2.js Modified: lib/catalog/v2.js (+3 -3) =================================================================== --- lib/catalog/v2.js 2014-10-30 11:37:55 +0900 (8355df4) +++ lib/catalog/v2.js 2014-10-30 11:44:33 +0900 (3872490) @@ -18,7 +18,7 @@ CatalogV2.prototype = { get datasets() { if (this._datasets) return this._datasets; - return this._datasets = Object.keys(this._raw.datasets) + return this._datasets = Object.keys(this._raw.datasets || {}) .map((function(datasetName) { return new Dataset(datasetName, this._raw.datasets[datasetName]); @@ -58,7 +58,7 @@ VolumeCollectionOwner.prototype = { get replicas() { if (this._replicas) return this._replicas; - return this._replicas = this._raw.replicas.map(function(replica) { + return this._replicas = (this._raw.replicas || []).map(function(replica) { return new Replica(replica); }); }, @@ -66,7 +66,7 @@ VolumeCollectionOwner.prototype = { get slices() { if (this._slices) return this._slices; - return this._slices = this._raw.slices.map(function(slice) { + return this._slices = (this._raw.slices || []).map(function(slice) { return new Slice(slice); }); }, -------------- next part -------------- HTML����������������������������...下載