Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ab76778 authored by Kenny Root's avatar Kenny Root Committed by Gerrit Code Review
Browse files

Merge "KeyChain: return null instead of throw"

parents c5748148 0150e482
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -336,7 +336,12 @@ public final class KeyChain {
        KeyChainConnection keyChainConnection = bind(context);
        KeyChainConnection keyChainConnection = bind(context);
        try {
        try {
            IKeyChainService keyChainService = keyChainConnection.getService();
            IKeyChainService keyChainService = keyChainConnection.getService();
            byte[] certificateBytes = keyChainService.getCertificate(alias);

            final byte[] certificateBytes = keyChainService.getCertificate(alias);
            if (certificateBytes == null) {
                return null;
            }

            TrustedCertificateStore store = new TrustedCertificateStore();
            TrustedCertificateStore store = new TrustedCertificateStore();
            List<X509Certificate> chain = store
            List<X509Certificate> chain = store
                    .getCertificateChain(toCertificate(certificateBytes));
                    .getCertificateChain(toCertificate(certificateBytes));