Handle incorrect presentationId passed from client

Closes https://github.com/bigbluebutton/bigbluebutton/issues/7516
This commit is contained in:
Anton Georgiev 2019-05-28 14:11:38 -04:00 committed by GitHub
parent 19483f7780
commit 0287e00b2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,17 +18,22 @@ export default function setPresentation(credentials, presentationId, podId) {
meetingId,
id: presentationId,
podId,
current: true,
});
if (currentPresentation && currentPresentation.id === presentationId) {
return Promise.resolve();
if (currentPresentation) {
if (currentPresentation.current) {
return Promise.resolve();
}
const payload = {
presentationId,
podId,
};
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
}
const payload = {
presentationId,
podId,
};
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
// did not find presentation with such id. abandon
// return Promise.resolve(); // will close the uploading modal
throw new Meteor.Error('presentation-not-found', `Did not find a presentation with id ${presentationId} in method setPresentation`);
}