Merge pull request #18986 from paultrudel/pid-null-error-fix

fix: Null pointer exception when parent meeting does not exist
This commit is contained in:
Gustavo Trott 2023-10-20 10:24:59 -03:00 committed by GitHub
commit 730803cc20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

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

View File

@ -127,10 +127,21 @@ class ApiController {
return return
} }
if(params.isBreakout == "true" && !params.parentMeetingID) { 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") invalid("parentMeetingIDMissing", "No parent meeting ID was provided for the breakout room")
return 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. // Ensure unique TelVoice. Uniqueness is not guaranteed by paramsProcessorUtil.
if (!params.voiceBridge) { if (!params.voiceBridge) {