diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2017-04-06 12:59:15 +0300 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2017-04-06 12:59:15 +0300 |
commit | 649d1243d5f7ec61838204e07a2309ec3fcd19d8 (patch) | |
tree | d5397bd3e692e50463a4702238c03eeada38420f | |
parent | 99565a68764ede1157d9df4cd92e7a7deb624541 (diff) |
avoid crash on urls with missing protocols
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Message.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index c433f9c95..61881c294 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -655,7 +655,7 @@ public class Message extends AbstractEntity { final String protocol = url.getProtocol(); final boolean encrypted = ref != null && ref.matches("([A-Fa-f0-9]{2}){48}"); return (AesGcmURLStreamHandler.PROTOCOL_NAME.equalsIgnoreCase(protocol) && encrypted) - || ((protocol.equalsIgnoreCase("http") || protocol.equalsIgnoreCase("https")) && (oob || encrypted)); + || (("http".equalsIgnoreCase(protocol) || "https".equalsIgnoreCase(protocol)) && (oob || encrypted)); } catch (MalformedURLException e) { return false; |