Skip to content
Snippets Groups Projects
Commit af28e28c authored by akwizgran's avatar akwizgran
Browse files

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.
parent e8b89f25
No related branches found
No related tags found
No related merge requests found
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment