1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 12:44:42 +00:00

Prevent crash

This commit is contained in:
M66B 2022-05-11 09:13:47 +02:00
parent d488470451
commit 27330ceddc

View file

@ -104,7 +104,12 @@ public class UriHelper {
return null;
if (tld.equals(host))
return null;
int dot = host.substring(0, host.length() - tld.length() - 1).lastIndexOf('.');
int len = host.length() - tld.length() - 1;
if (len < 0) {
Log.e("getRootDomain host=" + host + " tld=" + tld);
return host;
}
int dot = host.substring(0, len).lastIndexOf('.');
if (dot < 0)
return host;
return host.substring(dot + 1);