mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
IllegalArgumentException is better than DbException in case of bug #3.
If the app restarts after crashing and tries to return to the activity where it crashed, DatabaseConfig's encryption key will be null and no DB operations can be performed. It's better to crash again in that case than for all DB operations to fail. Fixing bug #3 will make this irrelevant.
This commit is contained in:
@@ -79,7 +79,7 @@ class H2Database extends JdbcDatabase {
|
||||
|
||||
protected Connection createConnection() throws SQLException {
|
||||
byte[] key = config.getEncryptionKey();
|
||||
if(key == null) return null;
|
||||
if(key == null) throw new IllegalStateException();
|
||||
char[] password = encodePassword(key);
|
||||
Properties props = new Properties();
|
||||
props.setProperty("user", "user");
|
||||
|
||||
Reference in New Issue
Block a user