rn: throw exception if default conference options set the room

See: https://github.com/jitsi/jitsi-meet/issues/4720
This commit is contained in:
Saúl Ibarra Corretgé 2019-10-08 12:37:08 +02:00 committed by Saúl Ibarra Corretgé
parent c45ee0230f
commit ab4b6be9d7
3 changed files with 12 additions and 1 deletions

View File

@ -33,6 +33,9 @@ public class JitsiMeet {
} }
public static void setDefaultConferenceOptions(JitsiMeetConferenceOptions options) { public static void setDefaultConferenceOptions(JitsiMeetConferenceOptions options) {
if (options != null && options.getRoom() != null) {
throw new RuntimeException("'room' must be null in the default conference options");
}
defaultConferenceOptions = options; defaultConferenceOptions = options;
} }

View File

@ -37,7 +37,6 @@
* List of domains used for universal linking. * List of domains used for universal linking.
*/ */
@property (copy, nonatomic, nullable) NSArray<NSString *> *universalLinkDomains; @property (copy, nonatomic, nullable) NSArray<NSString *> *universalLinkDomains;
/** /**
* Default conference options used for all conferences. These options will be merged * Default conference options used for all conferences. These options will be merged
* with those passed to JitsiMeetView.join when joining a conference. * with those passed to JitsiMeetView.join when joining a conference.

View File

@ -179,6 +179,15 @@
return _universalLinkDomains ? _universalLinkDomains : @[]; return _universalLinkDomains ? _universalLinkDomains : @[];
} }
- (void)setDefaultConferenceOptions:(JitsiMeetConferenceOptions *)defaultConferenceOptions {
if (defaultConferenceOptions != nil && _defaultConferenceOptions.room != nil) {
@throw [NSException exceptionWithName:@"RuntimeError"
reason:@"'room' must be null in the default conference options"
userInfo:nil];
}
_defaultConferenceOptions = defaultConferenceOptions;
}
#pragma mark - Private API methods #pragma mark - Private API methods
- (NSDictionary *)getDefaultProps { - (NSDictionary *)getDefaultProps {