don't try to save to read-only lock; check for non-existant games when

summarizing: together these fix crash when deleting after opening game
whose remote partner has been deleted.
This commit is contained in:
Eric House 2013-11-12 08:08:30 -08:00
parent 6719704117
commit e040aa388b
2 changed files with 6 additions and 3 deletions

View file

@ -256,7 +256,7 @@ public class DBUtils {
db.close();
}
if ( null == summary ) {
if ( null == summary && lock.canWrite() ) {
summary = GameUtils.summarize( context, lock );
saveSummary( context, lock, summary );
}

View file

@ -187,10 +187,13 @@ public class GameUtils {
public static GameSummary summarize( Context context, GameLock lock )
{
GameSummary result = null;
CurGameInfo gi = new CurGameInfo( context );
int gamePtr = loadMakeGame( context, gi, lock );
return summarizeAndClose( context, lock, gamePtr, gi );
if ( 0 < gamePtr ) {
result = summarizeAndClose( context, lock, gamePtr, gi );
}
return result;
}
public static long dupeGame( Context context, long rowidIn )