Merge pull request #19153 from Scroody/pid-null-error-fix

fix (bbb-web): Null pointer exception when parent meeting does not exist
This commit is contained in:
Gustavo Trott 2023-11-16 10:37:59 -03:00 committed by GitHub
commit 1f14f9a333
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -1152,6 +1152,11 @@ public class ParamsProcessorUtil {
return true;
}
public boolean parentMeetingExists(String parentMeetingId) {
Meeting meeting = ServiceUtils.findMeetingFromMeetingID(parentMeetingId);
return meeting != null;
}
/*************************************************
* Setters
************************************************/

View File

@ -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.