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; return true;
} }
public boolean parentMeetingExists(String parentMeetingId) {
Meeting meeting = ServiceUtils.findMeetingFromMeetingID(parentMeetingId);
return meeting != null;
}
/************************************************* /*************************************************
* Setters * Setters
************************************************/ ************************************************/

View File

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