fix crash when no radio's been chosen

This commit is contained in:
Eric House 2021-03-31 15:29:52 -07:00
parent 97962fceed
commit 63262ba9b3

View file

@ -128,27 +128,29 @@ public class NewWithKnowns extends LinearLayout
void onButtonPressed( ButtonCallbacks procs )
{
Context context = getContext();
String gameName = gameName();
switch ( mCurRadio ) {
case R.id.radio_known:
DBUtils.setStringFor( context, KP_NAME_KEY, mCurKnown );
procs.onUseKnown( mCurKnown, gameName );
break;
case R.id.radio_unknown:
case R.id.radio_default:
procs.onStartGame( gameName, mStandalone, false );
break;
case R.id.radio_configure:
procs.onStartGame( gameName, mStandalone, true );
break;
default:
Assert.failDbg();
break;
}
if ( 0 != mCurRadio ) {
Context context = getContext();
String gameName = gameName();
switch ( mCurRadio ) {
case R.id.radio_known:
DBUtils.setStringFor( context, KP_NAME_KEY, mCurKnown );
procs.onUseKnown( mCurKnown, gameName );
break;
case R.id.radio_unknown:
case R.id.radio_default:
procs.onStartGame( gameName, mStandalone, false );
break;
case R.id.radio_configure:
procs.onStartGame( gameName, mStandalone, true );
break;
default:
Assert.failDbg(); // fired
break;
}
String key = mStandalone ? KP_PREVSOLO_KEY : KP_PREVNET_KEY;
DBUtils.setIntFor( context, key, mCurRadio );
String key = mStandalone ? KP_PREVSOLO_KEY : KP_PREVNET_KEY;
DBUtils.setIntFor( context, key, mCurRadio );
}
}
private String gameName()