From 478ff88a820a2872ca31c6d39225a8978784d3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 20 Aug 2015 21:13:23 -0700 Subject: [PATCH] Don't crash if we couldn't generate a certificate Another crash workaround for #334. Even though this null check should be left there, since getCertificate() may return null for whatever reason. --- F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java b/F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java index 398e65d59..7fa094999 100644 --- a/F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java +++ b/F-Droid/src/org/fdroid/fdroid/net/WifiStateChangeService.java @@ -123,6 +123,10 @@ public class WifiStateChangeService extends Service { // the fingerprint for the local repo's signing key LocalRepoKeyStore localRepoKeyStore = LocalRepoKeyStore.get(context); Certificate localCert = localRepoKeyStore.getCertificate(); + // We were not able to generate/get a certificate + if (localCert == null) { + return null; + } FDroidApp.repo.fingerprint = Utils.calcFingerprint(localCert); /*