Default snippet type to 0 if it's null

Fixes #7551
fork-5.53.8
Moxie Marlinspike 2018-04-03 08:59:19 -07:00
rodzic 5f7c30e840
commit 0753ff85ed
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -135,9 +135,11 @@ public class SQLCipherMigrationHelper {
});
copyTable("thread", legacyDb, modernDb, (row, progress) -> {
Long snippetType = row.getAsLong("snippet_type");
if (snippetType == null) snippetType = 0L;
Pair<Long, String> plaintext = getPlaintextBody(legacyCipher, legacyAsymmetricCipher,
row.getAsLong("snippet_type"),
row.getAsString("snippet"));
snippetType, row.getAsString("snippet"));
row.put("snippet", plaintext.second);
row.put("snippet_type", plaintext.first);