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 85d70ce4d1..587828197b 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 @@ -1156,6 +1156,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 6384e465f3..88465fe72a 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 @@ -127,9 +127,15 @@ class ApiController { return } - if(params.isBreakout == "true" && !params.parentMeetingID) { - invalid("parentMeetingIDMissing", "No parent meeting ID was provided for the breakout room") - return + if(params.isBreakout == "true") { + if(!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.