Some fixes
This commit is contained in:
parent
591bfa567a
commit
0c11d999f9
|
@ -45,7 +45,7 @@ public class BaseActivity extends AppCompatActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
||||
/* if (BuildConfig.DEBUG) {
|
||||
/* if (BuildConfig.DEBUG) {
|
||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||
.detectDiskReads()
|
||||
.detectDiskWrites()
|
||||
|
|
|
@ -357,8 +357,10 @@ public class AccountDAO {
|
|||
*/
|
||||
private List<Account> cursorToListUser(Cursor c){
|
||||
//No element found
|
||||
if (c.getCount() == 0)
|
||||
if (c.getCount() == 0) {
|
||||
c.close();
|
||||
return null;
|
||||
}
|
||||
List<Account> accounts = new ArrayList<>();
|
||||
while (c.moveToNext() ) {
|
||||
//New user
|
||||
|
|
|
@ -133,8 +133,10 @@ public class TempMuteDAO {
|
|||
*/
|
||||
private List<String> cursorToTimeMute(Cursor c){
|
||||
//No element found
|
||||
if (c.getCount() == 0)
|
||||
if (c.getCount() == 0) {
|
||||
c.close();
|
||||
return null;
|
||||
}
|
||||
List<String> timeMutes = new ArrayList<>();
|
||||
while (c.moveToNext() ) {
|
||||
timeMutes.add(c.getString(c.getColumnIndex(Sqlite.COL_TARGETED_USER_ID)));
|
||||
|
|
|
@ -164,8 +164,10 @@ public class TimelineCacheDAO {
|
|||
*/
|
||||
private Status cursorToSingleStatus(Cursor c){
|
||||
//No element found
|
||||
if (c.getCount() == 0)
|
||||
if (c.getCount() == 0) {
|
||||
c.close();
|
||||
return null;
|
||||
}
|
||||
c.moveToFirst();
|
||||
Status status = null;
|
||||
try {
|
||||
|
@ -187,8 +189,10 @@ public class TimelineCacheDAO {
|
|||
*/
|
||||
private List<Status> cursorToListStatus(Cursor c){
|
||||
//No element found
|
||||
if (c.getCount() == 0)
|
||||
if (c.getCount() == 0) {
|
||||
c.close();
|
||||
return null;
|
||||
}
|
||||
List<Status> statuses = new ArrayList<>();
|
||||
while (c.moveToNext() ) {
|
||||
//Restore cached status
|
||||
|
|
Loading…
Reference in New Issue