Fix NPE's
This commit is contained in:
parent
b714389bb3
commit
f3a65881e4
2 changed files with 6 additions and 0 deletions
|
@ -47,6 +47,9 @@ public class DatabaseHelper {
|
|||
|
||||
private SQLiteAPI.SQLiteConnection openConnection(boolean readonly) {
|
||||
SQLiteAPI.SQLiteConnection conn = app.getSQLiteAPI().getOrCreateDatabase(DB_NAME, readonly);
|
||||
if (conn == null) {
|
||||
return null;
|
||||
}
|
||||
if (conn.getVersion() == 0 || DB_VERSION != conn.getVersion()) {
|
||||
if (readonly) {
|
||||
conn.close();
|
||||
|
|
|
@ -112,6 +112,9 @@ public class MapMarkersDbHelper {
|
|||
|
||||
private SQLiteConnection openConnection(boolean readonly) {
|
||||
SQLiteConnection conn = context.getSQLiteAPI().getOrCreateDatabase(DB_NAME, readonly);
|
||||
if (conn == null) {
|
||||
return conn;
|
||||
}
|
||||
int version = conn.getVersion();
|
||||
if (version == 0 || DB_VERSION != version) {
|
||||
if (readonly) {
|
||||
|
|
Loading…
Reference in a new issue