diff --git a/app/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java b/app/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java index e53dea2b9d09..634cebb63f9a 100644 --- a/app/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java @@ -313,12 +313,12 @@ protected void onPreExecute() { @Override protected String doInBackground(Void... voids) { - Context context = mWeakContext.get(); // fetch private/public key // if available // - store public key // - decrypt private key, store unencrypted private key in database + Context context = mWeakContext.get(); GetPublicKeyOperation publicKeyOperation = new GetPublicKeyOperation(); if (user != null) { RemoteOperationResult publicKeyResult = publicKeyOperation.execute(user, context); @@ -354,6 +354,7 @@ protected String doInBackground(Void... voids) { @Override protected void onPostExecute(String privateKey) { super.onPostExecute(privateKey); + Context context = mWeakContext.get(); if (context == null) { Log_OC.e(TAG, "Context lost after fetching private keys.");