avoid crash on urls with missing protocols
This commit is contained in:
parent
99565a6876
commit
649d1243d5
|
@ -655,7 +655,7 @@ public class Message extends AbstractEntity {
|
||||||
final String protocol = url.getProtocol();
|
final String protocol = url.getProtocol();
|
||||||
final boolean encrypted = ref != null && ref.matches("([A-Fa-f0-9]{2}){48}");
|
final boolean encrypted = ref != null && ref.matches("([A-Fa-f0-9]{2}){48}");
|
||||||
return (AesGcmURLStreamHandler.PROTOCOL_NAME.equalsIgnoreCase(protocol) && encrypted)
|
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) {
|
} catch (MalformedURLException e) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue