do not accept empty credentials as ice-restart

This commit is contained in:
Daniel Gultsch 2022-08-10 09:11:09 +02:00
parent 508e1ac1bd
commit fe3433e427

View file

@ -182,6 +182,9 @@ public class RtpContentMap {
final IceUdpTransportInfo.Credentials credentials =
Iterables.getFirst(allCredentials, null);
if (allCredentials.size() == 1 && credentials != null) {
if (Strings.isNullOrEmpty(credentials.password) || Strings.isNullOrEmpty(credentials.ufrag)) {
throw new IllegalStateException("Credentials are missing password or ufrag");
}
return credentials;
}
throw new IllegalStateException("Content map does not have distinct credentials");