From 4c39c1ec30035473ecf3ec8e09da31f482b782fc Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 30 Sep 2013 15:52:10 -0400 Subject: [PATCH] fixed issue with install script erroring out if redis host is not defined --- src/redis.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/redis.js b/src/redis.js index 91bd583f85..c66c720788 100644 --- a/src/redis.js +++ b/src/redis.js @@ -2,14 +2,13 @@ var redis = require('redis'), utils = require('./../public/src/utils.js'), winston = require('winston'), - nconf = require('nconf'); + nconf = require('nconf'), + redis_socket_or_host = nconf.get('redis:host'); - var redis_socket_or_host = nconf.get('redis:host') - if(redis_socket_or_host.indexOf('/')>=0) { + if (redis_socket_or_host && redis_socket_or_host.indexOf('/')>=0) { /* If redis.host contains a path name character, use the unix dom sock connection. ie, /tmp/redis.sock */ RedisDB.exports = redis.createClient(nconf.get('redis:host')) - } - else { + } else { /* Else, connect over tcp/ip */ RedisDB.exports = redis.createClient(nconf.get('redis:port'), nconf.get('redis:host')); }