mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-02-07 04:39:13 +01:00
DroidFish: Fixed possible NPE when reading scid database.
This commit is contained in:
parent
987e0d7d3e
commit
1ce7d2298e
|
@ -79,8 +79,6 @@ public class LoadScid extends ListActivity {
|
|||
private Thread workThread = null;
|
||||
private CountDownLatch progressLatch = null;
|
||||
|
||||
private int idIdx;
|
||||
private int summaryIdx;
|
||||
private boolean resultSentBack = false;
|
||||
|
||||
|
||||
|
@ -100,8 +98,6 @@ public class LoadScid extends ListActivity {
|
|||
}
|
||||
@Override
|
||||
public void onLoadFinished(Loader<Cursor> loader, final Cursor cursor) {
|
||||
idIdx = cursor.getColumnIndex("_id");
|
||||
summaryIdx = cursor.getColumnIndex("summary");
|
||||
workThread = new Thread(new Runnable() {
|
||||
public void run() {
|
||||
r.run(cursor);
|
||||
|
@ -334,6 +330,8 @@ public class LoadScid extends ListActivity {
|
|||
|
||||
private void addGameInfo(Cursor cursor) {
|
||||
GameInfo gi = new GameInfo();
|
||||
int idIdx = cursor.getColumnIndex("_id");
|
||||
int summaryIdx = cursor.getColumnIndex("summary");
|
||||
gi.gameId = cursor.getInt(idIdx);
|
||||
gi.summary = cursor.getString(summaryIdx);
|
||||
gamesInFile.add(gi);
|
||||
|
|
Loading…
Reference in New Issue
Block a user