Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit bd951e1

Browse files
Merge pull request #1430 from wking/redis-brain-null-path
redis-brain: Check if info.path is null before replacing strings
2 parents 7d9a377 + 6ba6d37 commit bd951e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/scripts/redis-brain.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Url = require "url"
2121
Redis = require "redis"
2222

2323
module.exports = (robot) ->
24-
info = Url.parse process.env.REDISTOGO_URL or process.env.REDISCLOUD_URL or process.env.BOXEN_REDIS_URL or process.env.REDIS_URL or 'redis://localhost:6379/hubot', true
24+
info = Url.parse process.env.REDISTOGO_URL or process.env.REDISCLOUD_URL or process.env.BOXEN_REDIS_URL or process.env.REDIS_URL or 'redis://localhost:6379', true
2525
client = Redis.createClient(info.port, info.hostname)
26-
prefix = info.path.replace('/', '') or 'hubot'
26+
prefix = info.path?.replace('/', '') or 'hubot'
2727

2828
robot.brain.setAutoSave false
2929

0 commit comments

Comments
 (0)