1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Make deleteCertificate null-safe

This commit is contained in:
Jan Berkel 2015-01-14 03:45:09 +01:00
parent 833d9c5de8
commit 4808406739

View File

@ -1894,9 +1894,15 @@ public class Account implements BaseAccount, StoreConfig {
public void deleteCertificates() {
LocalKeyStore localKeyStore = LocalKeyStore.getInstance();
Uri uri = Uri.parse(getStoreUri());
String storeUri = getStoreUri();
if (storeUri != null) {
Uri uri = Uri.parse(storeUri);
localKeyStore.deleteCertificate(uri.getHost(), uri.getPort());
uri = Uri.parse(getTransportUri());
}
String transportUri = getTransportUri();
if (transportUri != null) {
Uri uri = Uri.parse(transportUri);
localKeyStore.deleteCertificate(uri.getHost(), uri.getPort());
}
}
}