mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
fix race condition leading to NPE
This commit is contained in:
parent
4f63ad3b83
commit
5bce759d32
1 changed files with 5 additions and 4 deletions
|
@ -1521,8 +1521,9 @@ public class DBUtils {
|
||||||
// Map of groups rowid (= summaries.groupid) to group info record
|
// Map of groups rowid (= summaries.groupid) to group info record
|
||||||
protected static Map<Long,GameGroupInfo> getGroups( Context context )
|
protected static Map<Long,GameGroupInfo> getGroups( Context context )
|
||||||
{
|
{
|
||||||
if ( null == s_groupsCache ) {
|
Map<Long,GameGroupInfo> result = s_groupsCache;
|
||||||
Map<Long,GameGroupInfo> result = new HashMap<>();
|
if ( null == result ) {
|
||||||
|
result = new HashMap<>();
|
||||||
|
|
||||||
// Select all groups. For each group get the number of games in
|
// Select all groups. For each group get the number of games in
|
||||||
// that group. There should be a way to do that with one query
|
// that group. There should be a way to do that with one query
|
||||||
|
@ -1561,8 +1562,8 @@ public class DBUtils {
|
||||||
}
|
}
|
||||||
s_groupsCache = result;
|
s_groupsCache = result;
|
||||||
}
|
}
|
||||||
Log.d( TAG, "getGroups() => %s", s_groupsCache );
|
Log.d( TAG, "getGroups() => %s", result );
|
||||||
return s_groupsCache;
|
return result;
|
||||||
} // getGroups
|
} // getGroups
|
||||||
|
|
||||||
private static void readTurnInfo( SQLiteDatabase db, long groupID,
|
private static void readTurnInfo( SQLiteDatabase db, long groupID,
|
||||||
|
|
Loading…
Reference in a new issue