fix NPE rotating phone when new invite-now alert up

This commit is contained in:
Eric House 2020-11-30 10:26:08 -08:00
parent 99a7930dfb
commit ebbb6dd7da

View file

@ -130,7 +130,6 @@ public class BoardDelegate extends DelegateBase
private boolean m_haveStartedShowing; private boolean m_haveStartedShowing;
private Wrapper mNFCWrapper; private Wrapper mNFCWrapper;
private InvitesNeededAlert.Wrapper mINAWrapper;
public class TimerRunnable implements Runnable { public class TimerRunnable implements Runnable {
private int m_why; private int m_why;
@ -421,7 +420,7 @@ public class BoardDelegate extends DelegateBase
.create(); .create();
break; break;
case DLG_INVITE: case DLG_INVITE:
dialog = mINAWrapper.make( alert, params ); dialog = getINAWrapper().make( alert, params );
break; break;
case ENABLE_NFC: case ENABLE_NFC:
@ -1507,7 +1506,7 @@ public class BoardDelegate extends DelegateBase
post( new Runnable() { post( new Runnable() {
@Override @Override
public void run() { public void run() {
mINAWrapper.dismiss(); getINAWrapper().dismiss();
finish(); finish();
} }
} ); } );
@ -2459,14 +2458,26 @@ public class BoardDelegate extends DelegateBase
private void showInviteAlertIf() private void showInviteAlertIf()
{ {
if ( alertOrderAt( StartAlertOrder.INVITE ) && ! isFinishing() ) { if ( alertOrderAt( StartAlertOrder.INVITE ) && ! isFinishing() ) {
boolean isRematch = null != m_summary && m_summary.hasRematchInfo(); showOrHide( getINAWrapper() );
if ( null == mINAWrapper ) {
mINAWrapper = new InvitesNeededAlert.Wrapper( this );
}
mINAWrapper.showOrHide( m_mySIS.isServer, m_mySIS.nMissing, isRematch );
} }
} }
private void showOrHide( InvitesNeededAlert.Wrapper wrapper )
{
boolean isRematch = null != m_summary && m_summary.hasRematchInfo();
wrapper.showOrHide( m_mySIS.isServer, m_mySIS.nMissing, isRematch );
}
private InvitesNeededAlert.Wrapper mINAWrapper;
private InvitesNeededAlert.Wrapper getINAWrapper()
{
if ( null == mINAWrapper ) {
mINAWrapper = new InvitesNeededAlert.Wrapper( this );
showOrHide( mINAWrapper );
}
return mINAWrapper;
}
private boolean doZoom( int zoomBy ) private boolean doZoom( int zoomBy )
{ {
boolean handled = null != m_jniThread; boolean handled = null != m_jniThread;