Skip to content

Commit

Permalink
Fix for NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
moxie0 committed Feb 26, 2014
1 parent 5a62856 commit 3b25b87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/org/thoughtcrime/securesms/database/PartDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;

Expand Down Expand Up @@ -408,7 +409,10 @@ public void deleteParts(long mmsId) {
cursor = database.query(TABLE_NAME, new String[] {DATA}, MMS_ID + " = ?", new String[] {mmsId+""}, null, null, null);

while (cursor != null && cursor.moveToNext()) {
new File(cursor.getString(0)).delete();
String data = cursor.getString(0);
if (!TextUtils.isEmpty(data)) {
new File(cursor.getString(0)).delete();

This comment has been minimized.

Copy link
@schoettl

schoettl Feb 26, 2014

Why not pass the variable data just assigned with cursor.getString(0)?

This comment has been minimized.

Copy link
@moxie0

moxie0 Feb 27, 2014

Author Contributor

Yep, that's a mistake.

}
}
} finally {
if (cursor != null)
Expand Down

1 comment on commit 3b25b87

@WhisperBTC
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! BitHub has sent payment of $83.51USD for this commit.

Please sign in to comment.