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:
akwizgran
2013-12-19 23:33:38 +00:00
parent bd566fdb8f
commit e8d864c004

View File

@@ -78,7 +78,7 @@ class H2Database extends JdbcDatabase {
protected Connection createConnection() throws SQLException {
byte[] key = config.getEncryptionKey();
if(key == null) throw new IllegalStateException();
if(key == null) return null;
char[] password = encodePassword(key);
Properties props = new Properties();
props.setProperty("user", "user");