Skip to content

Commit

Permalink
Fix TypeError when submitting w/o SLACK_CHANNELS config
Browse files Browse the repository at this point in the history
Introduced with the merge of rauchg#152,
the problem was if the `SLACK_CHANNELS` environment variable wasn't set
up, then no hidden form element with the listed channels would be
included. Therefore, our `channel` variable would be `undefined`, and a
direct access of the `value` property would crash the app.
  • Loading branch information
andrewsardone committed Mar 10, 2016
1 parent eefd279 commit d6d9db7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/assets/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ body.addEventListener('submit', function(ev){
button.disabled = true;
button.className = '';
button.innerHTML = 'Please Wait';
invite(channel.value, coc && coc.checked ? 1 : 0, email.value, function(err, msg){
invite(channel ? channel.value : null, coc && coc.checked ? 1 : 0, email.value, function(err, msg){
if (err) {
button.removeAttribute('disabled');
button.className = 'error';
Expand Down

0 comments on commit d6d9db7

Please sign in to comment.