From 649d1243d5f7ec61838204e07a2309ec3fcd19d8 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 6 Apr 2017 11:59:15 +0200 Subject: [PATCH] avoid crash on urls with missing protocols --- src/main/java/eu/siacs/conversations/entities/Message.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index c433f9c9..61881c29 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;