Skip to content

Commit 0be9901

Browse files
committed
Avoid cipher initalization for missing prefs
1 parent d52a1d2 commit 0be9901

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/src/main/java/org/thoughtcrime/securesms/crypto/EncryptedPreferences.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,10 @@ private Object getDecryptedObject(String key) {
367367
}
368368
}
369369
Object value = null;
370-
MasterCipher masterCipher = getCipher();
371370
synchronized (cache) {
372371
String encryptedValue = sharedPreferences.getString(key, null);
373372
if (encryptedValue != null) {
374-
byte[] bytes = decrypt(key, encryptedValue, masterCipher);
373+
byte[] bytes = decrypt(key, encryptedValue, getCipher());
375374
ByteBuffer buffer = ByteBuffer.wrap(bytes);
376375
buffer.position(0);
377376
int typeId = buffer.getInt();

0 commit comments

Comments
 (0)