Skip to content

Commit

Permalink
Left out a null check.
Browse files Browse the repository at this point in the history
  • Loading branch information
enyim committed Jul 30, 2010
1 parent 6f26c8d commit 2f54dbb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Northscale.Store/NorthScalePool.cs
Expand Up @@ -115,18 +115,20 @@ private void InitNodes(ClusterConfig config)
IEnumerable<IPEndPoint> endpoints;
IMemcachedNodeLocator locator;

if (config.vBucketServerMap == null)
if (config == null || config.vBucketServerMap == null)
{
// no vbucket config, use the node list and the ports
var portType = this.configuration.Port;

endpoints = from node in config.nodes
where node.status == "healthy"
select new IPEndPoint(
IPAddress.Parse(node.hostname),
(portType == BucketPortType.Proxy
? node.ports.proxy
: node.ports.direct));
endpoints = config == null
? Enumerable.Empty<IPEndPoint>()
: (from node in config.nodes
where node.status == "healthy"
select new IPEndPoint(
IPAddress.Parse(node.hostname),
(portType == BucketPortType.Proxy
? node.ports.proxy
: node.ports.direct)));

locator = this.configuration.CreateNodeLocator() ?? new KetamaNodeLocator();
}
Expand Down

0 comments on commit 2f54dbb

Please sign in to comment.