Prevent NPE

This commit is contained in:
Martin Fietz 2015-09-19 20:38:45 +02:00
parent b3094fa5f0
commit a475bf112f
1 changed files with 5 additions and 1 deletions

View File

@ -309,7 +309,11 @@ public class PodDBAdapter {
dbHelper.close();
dbHelper = null;
}
return context.deleteDatabase(PodDBAdapter.DATABASE_NAME);
if(context != null) { // may not have been initialized
return context.deleteDatabase(PodDBAdapter.DATABASE_NAME);
} else {
return false;
}
}
/**