fix NPE (race condition around deletion?)

Check for null. Not sure how I got it there, but there's little harm in
failing silently.
This commit is contained in:
Eric House 2018-12-06 06:23:40 -08:00
parent 95c11eec07
commit c4ac96ede8

View file

@ -274,9 +274,13 @@ public class GameUtils {
public static void deleteGame( Context context, GameLock lock, boolean informNow )
{
tellDied( context, lock, informNow );
Utils.cancelNotification( context, (int)lock.getRowid() );
DBUtils.deleteGame( context, lock );
if ( null != lock ) {
tellDied( context, lock, informNow );
Utils.cancelNotification( context, (int)lock.getRowid() );
DBUtils.deleteGame( context, lock );
} else {
Log.e( TAG, "deleteGame(): null lock; doing nothing" );
}
}
public static boolean deleteGame( Context context, long rowid,