mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Prevent crash
This commit is contained in:
parent
d488470451
commit
27330ceddc
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue