diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 977c9fc27..a072e9d9a 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -77,7 +77,7 @@ public class FileBackend { private static final String FILE_PROVIDER = ".files"; private static final float IGNORE_PADDING = 0.15f; - private XmppConnectionService mXmppConnectionService; + private final XmppConnectionService mXmppConnectionService; public FileBackend(XmppConnectionService service) { this.mXmppConnectionService = service; diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/SessionDescription.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/SessionDescription.java index af7213220..52762407f 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/SessionDescription.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/SessionDescription.java @@ -143,14 +143,16 @@ public class SessionDescription { final ArrayListMultimap mediaAttributes = ArrayListMultimap.create(); final String ufrag = transport.getAttribute("ufrag"); final String pwd = transport.getAttribute("pwd"); - if (!Strings.isNullOrEmpty(ufrag)) { - mediaAttributes.put("ice-ufrag", ufrag); + if (Strings.isNullOrEmpty(ufrag)) { + throw new IllegalArgumentException("Transport element is missing required ufrag attribute"); } checkNoWhitespace(ufrag, "ufrag value must not contain any whitespaces"); - if (!Strings.isNullOrEmpty(pwd)) { - mediaAttributes.put("ice-pwd", pwd); + mediaAttributes.put("ice-ufrag", ufrag); + if (Strings.isNullOrEmpty(pwd)) { + throw new IllegalArgumentException("Transport element is missing required pwd attribute"); } checkNoWhitespace(pwd, "pwd value must not contain any whitespaces"); + mediaAttributes.put("ice-pwd", pwd); mediaAttributes.put("ice-options", HARDCODED_ICE_OPTIONS); final IceUdpTransportInfo.Fingerprint fingerprint = transport.getFingerprint(); if (fingerprint != null) {