mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +01:00
Throw DbException if database encryption key is missing.
This can happen on Android if the app is automatically restarted after a crash.
This commit is contained in:
@@ -78,7 +78,7 @@ class H2Database extends JdbcDatabase {
|
|||||||
|
|
||||||
protected Connection createConnection() throws SQLException {
|
protected Connection createConnection() throws SQLException {
|
||||||
byte[] key = config.getEncryptionKey();
|
byte[] key = config.getEncryptionKey();
|
||||||
if(key == null) throw new IllegalStateException();
|
if(key == null) return null;
|
||||||
char[] password = encodePassword(key);
|
char[] password = encodePassword(key);
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.setProperty("user", "user");
|
props.setProperty("user", "user");
|
||||||
|
|||||||
Reference in New Issue
Block a user