Prevent null error when parent meeting does not exist

This commit is contained in:
Paul Trudel 2023-10-19 19:54:43 +00:00
parent d24cdfde6f
commit bc7c3143ba
2 changed files with 14 additions and 3 deletions

View File

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

View File

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