From bc7c3143bad874496cc1004c7bfdf7b6721bd1f3 Mon Sep 17 00:00:00 2001 From: Paul Trudel Date: Thu, 19 Oct 2023 19:54:43 +0000 Subject: [PATCH 1/3] Prevent null error when parent meeting does not exist --- .../org/bigbluebutton/api/ParamsProcessorUtil.java | 5 +++++ .../web/controllers/ApiController.groovy | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) 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. From 3dc4cb28d97f3f1a1fcb35d4942daa0ae56cad4d Mon Sep 17 00:00:00 2001 From: Paul Trudel <35616208+paultrudel@users.noreply.github.com> Date: Fri, 20 Oct 2023 08:27:09 -0400 Subject: [PATCH 2/3] Update bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy Co-authored-by: Gustavo Trott --- .../org/bigbluebutton/web/controllers/ApiController.groovy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 88465fe72a..270c6bb86a 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,7 +127,12 @@ class ApiController { return } - if(params.isBreakout == "true") { + Boolean isBreakoutRoom = false + if (!StringUtils.isEmpty(params.isBreakout)) { + isBreakoutRoom = Boolean.parseBoolean(params.isBreakout) + } + + if(isBreakoutRoom) { if(!params.parentMeetingID) { invalid("parentMeetingIDMissing", "No parent meeting ID was provided for the breakout room") return From d33a1c028a61efff2fcb8ddca86c22ad43974c94 Mon Sep 17 00:00:00 2001 From: Paul Trudel <35616208+paultrudel@users.noreply.github.com> Date: Fri, 20 Oct 2023 08:27:15 -0400 Subject: [PATCH 3/3] Update bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy Co-authored-by: Gustavo Trott --- .../org/bigbluebutton/web/controllers/ApiController.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 270c6bb86a..8e49638816 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 @@ -133,7 +133,7 @@ class ApiController { } if(isBreakoutRoom) { - if(!params.parentMeetingID) { + if(StringUtils.isEmpty(params.parentMeetingID)) { invalid("parentMeetingIDMissing", "No parent meeting ID was provided for the breakout room") return }