diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java index 6ab1604b0f..007ab26f1a 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java @@ -1152,6 +1152,11 @@ public class ParamsProcessorUtil { return true; } + public boolean parentMeetingExists(String parentMeetingId) { + Meeting meeting = ServiceUtils.findMeetingFromMeetingID(parentMeetingId); + return meeting != null; + } + /************************************************* * Setters ************************************************/ diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index 9eee398ae7..4bae5b7714 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -130,9 +130,20 @@ class ApiController { return } - if(params.isBreakout == "true" && !params.parentMeetingID) { - invalid("parentMeetingIDMissing", "No parent meeting ID was provided for the breakout room") - return + Boolean isBreakoutRoom = false + if (!StringUtils.isEmpty(params.isBreakout)) { + isBreakoutRoom = Boolean.parseBoolean(params.isBreakout) + } + + if(isBreakoutRoom) { + if(StringUtils.isEmpty(params.parentMeetingID)) { + invalid("parentMeetingIDMissing", "No parent meeting ID was provided for the breakout room") + return + } + if(!paramsProcessorUtil.parentMeetingExists(params.parentMeetingID)) { + invalid("parentMeetingDoesNotExist", "No parent meeting exists for the breakout room") + return + } } // Ensure unique TelVoice. Uniqueness is not guaranteed by paramsProcessorUtil.