Skip to content

Commit d6d9db7

Browse files
committed
Fix TypeError when submitting w/o SLACK_CHANNELS config
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.
1 parent eefd279 commit d6d9db7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/assets/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ body.addEventListener('submit', function(ev){
1919
button.disabled = true;
2020
button.className = '';
2121
button.innerHTML = 'Please Wait';
22-
invite(channel.value, coc && coc.checked ? 1 : 0, email.value, function(err, msg){
22+
invite(channel ? channel.value : null, coc && coc.checked ? 1 : 0, email.value, function(err, msg){
2323
if (err) {
2424
button.removeAttribute('disabled');
2525
button.className = 'error';

0 commit comments

Comments
 (0)