mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
Merge pull request #3228 from nextcloud/npeOnRetrievingMnemonic
NPE on some devices when showing Mnemonic
This commit is contained in:
commit
c0c1e0085b
1 changed files with 16 additions and 11 deletions
|
@ -864,22 +864,27 @@ public class Preferences extends PreferenceActivity
|
|||
if (!LOCK_NONE.equals(pendingLock)) {
|
||||
enableLock(pendingLock);
|
||||
}
|
||||
} else if (requestCode == PassCodeManager.PASSCODE_ACTIVITY && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
||||
data.getIntExtra(RequestCredentialsActivity.KEY_CHECK_RESULT,
|
||||
} else if (requestCode == PassCodeManager.PASSCODE_ACTIVITY && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (data == null) {
|
||||
DisplayUtils.showSnackMessage(this, "Error retrieving mnemonic!");
|
||||
} else {
|
||||
if (data.getIntExtra(RequestCredentialsActivity.KEY_CHECK_RESULT,
|
||||
RequestCredentialsActivity.KEY_CHECK_RESULT_FALSE) ==
|
||||
RequestCredentialsActivity.KEY_CHECK_RESULT_TRUE) {
|
||||
|
||||
ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(getContentResolver());
|
||||
String mnemonic = arbitraryDataProvider.getValue(mAccount.name, EncryptionUtils.MNEMONIC);
|
||||
ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(getContentResolver());
|
||||
String mnemonic = arbitraryDataProvider.getValue(mAccount.name, EncryptionUtils.MNEMONIC);
|
||||
|
||||
int accentColor = ThemeUtils.primaryAccentColor(this);
|
||||
int accentColor = ThemeUtils.primaryAccentColor(this);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.FallbackTheming_Dialog);
|
||||
builder.setTitle(ThemeUtils.getColoredTitle(getString(R.string.prefs_e2e_mnemonic), accentColor));
|
||||
builder.setMessage(mnemonic);
|
||||
builder.setPositiveButton(ThemeUtils.getColoredTitle(getString(R.string.common_ok), accentColor),
|
||||
(dialog, which) -> dialog.dismiss());
|
||||
builder.show();
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.FallbackTheming_Dialog);
|
||||
builder.setTitle(ThemeUtils.getColoredTitle(getString(R.string.prefs_e2e_mnemonic), accentColor));
|
||||
builder.setMessage(mnemonic);
|
||||
builder.setPositiveButton(ThemeUtils.getColoredTitle(getString(R.string.common_ok), accentColor),
|
||||
(dialog, which) -> dialog.dismiss());
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue