guard against possibly undefined team data in 'setPadMetadata'

This commit is contained in:
ansuz 2021-08-12 19:15:52 +05:30
parent 036248a659
commit e4879b5117
1 changed files with 2 additions and 0 deletions

View File

@ -2159,6 +2159,8 @@ define([
if (!data.channel) { return void cb({ error: 'ENOTFOUND'}); }
if (!data.command) { return void cb({ error: 'EINVAL' }); }
var s = getStore(data.teamId);
if (!s) { return void cb({ error: 'ENOTFOUND' }); }
var otherChannels = data.channels;
delete data.channels;
s.rpc.setMetadata(data, function (err, res) {