mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-01 06:19:57 +01:00
return empty array rather than null when query succeeds but produces
no result.
This commit is contained in:
parent
69f868722f
commit
db8364c285
1 changed files with 2 additions and 7 deletions
|
@ -451,10 +451,8 @@ public class DBUtils {
|
|||
String selection = DBHelper.RELAYID + "='" + relayID + "'";
|
||||
Cursor cursor = db.query( DBHelper.TABLE_NAME_SUM, columns,
|
||||
selection, null, null, null, null );
|
||||
result = new long[cursor.getCount()];
|
||||
for ( int ii = 0; cursor.moveToNext(); ++ii ) {
|
||||
if ( null == result ) {
|
||||
result = new long[cursor.getCount()];
|
||||
}
|
||||
result[ii] = cursor.getLong( cursor.getColumnIndex(ROW_ID) );
|
||||
}
|
||||
cursor.close();
|
||||
|
@ -473,11 +471,8 @@ public class DBUtils {
|
|||
String selection = String.format( DBHelper.GAMEID + "=%d", gameID );
|
||||
Cursor cursor = db.query( DBHelper.TABLE_NAME_SUM, columns,
|
||||
selection, null, null, null, null );
|
||||
|
||||
result = new long[cursor.getCount()];
|
||||
for ( int ii = 0; cursor.moveToNext(); ++ii ) {
|
||||
if ( null == result ) {
|
||||
result = new long[cursor.getCount()];
|
||||
}
|
||||
result[ii] = cursor.getLong( cursor.getColumnIndex(ROW_ID) );
|
||||
}
|
||||
cursor.close();
|
||||
|
|
Loading…
Reference in a new issue