1
0
mirror of https://github.com/etesync/android synced 2024-11-22 16:08:13 +00:00

ContactsSyncManager: URL fix

* ContactsSyncManager: don't try to download external resources which do not have a valid URL
This commit is contained in:
Ricki Hirner 2015-11-20 10:12:48 +01:00
parent fce2b85991
commit 5ccdafa074
No known key found for this signature in database
GPG Key ID: C4A212CF0B2B4566

View File

@ -265,6 +265,11 @@ public class ContactsSyncManager extends SyncManager {
public byte[] download(String url, String accepts) { public byte[] download(String url, String accepts) {
HttpUrl httpUrl = HttpUrl.parse(url); HttpUrl httpUrl = HttpUrl.parse(url);
if (httpUrl == null) {
log.error("Invalid external resource URL");
return null;
}
String host = httpUrl.host(); String host = httpUrl.host();
if (host == null) { if (host == null) {
log.error("External resource URL doesn't specify a host name"); log.error("External resource URL doesn't specify a host name");