Skip to content
Snippets Groups Projects
Commit be0f0367 authored by Gabriel Engel's avatar Gabriel Engel
Browse files

Merge pull request #3275 from RocketChat/fix-integrations-not-allow-empty-channels

Fix outgoing integrations erroring out when a channel isn't provided
parents aaa9623e e7d05f28
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,7 @@ Meteor.methods
if integration.urls.length is 0
throw new Meteor.Error 'error-invalid-urls', 'Invalid URLs', { method: 'addOutgoingIntegration' }
channels = _.map(integration.channel.split(','), (channel) -> s.trim(channel))
channels = if integration.channel then _.map(integration.channel.split(','), (channel) -> s.trim(channel)) else []
for channel in channels
if channel[0] not in ['@', '#']
......
......@@ -20,7 +20,7 @@ Meteor.methods
else
integration.channel = undefined
channels = _.map(integration.channel.split(','), (channel) -> s.trim(channel))
channels = if integration.channel then _.map(integration.channel.split(','), (channel) -> s.trim(channel)) else []
for channel in channels
if channel[0] not in ['@', '#']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment