catch NPE Play console reports thrown by OS

No clue why this might be happening, but perhaps catching and dropping
will prevent a bad user experience?
This commit is contained in:
Eric House 2017-05-07 17:06:26 -07:00
parent c3bfbfb956
commit 055f54611d
2 changed files with 20 additions and 10 deletions

View file

@ -32,6 +32,7 @@
guess, &quot;Top4997&quot; instead)</li>
<li>Made new CollegeEngFull wordlist available for download in
case you miss those 54 words</li>
<li>Addressed crash reported through Google (thanks!)</li>
</ul>
<p>(The full changelog

View file

@ -529,9 +529,7 @@ public class BoardDelegate extends DelegateBase
dialog = ab.create();
// Hack: I can't prevent screen rotation from duplicating this alert
if ( null != m_inviteAlert ) {
m_inviteAlert.dismiss();
}
dismissInviteAlert();
m_inviteAlert = alert;
alert.setOnCancelListener( new DBAlert.OnCancelListener() {
@Override
@ -2206,14 +2204,28 @@ public class BoardDelegate extends DelegateBase
}
if ( 0 == nMissing || !m_relayMissing ) {
Log.d( TAG, "dismissing invite alert %H", m_inviteAlert );
if ( null != m_inviteAlert ) {
m_inviteAlert.dismiss();
}
dismissInviteAlert();
}
}
} );
}
private void dismissInviteAlert()
{
if ( null != m_inviteAlert ) {
// Play Console reports a crash inside DialogFragment.dismiss()
// resulting from getFragmentManager() returning null. That
// probably means I'm on the way out and can safely drop? Let's
// see....
try {
m_inviteAlert.dismiss();
} catch ( NullPointerException npe ) {
Assert.assertFalse( BuildConfig.DEBUG );
}
m_inviteAlert = null;
}
}
private void pingBTRemotes()
{
if ( null != m_connTypes
@ -2786,10 +2798,7 @@ public class BoardDelegate extends DelegateBase
DBUtils.recordInviteSent( m_activity, m_rowid, means, dev );
if ( !invitesSent ) {
if ( null != m_inviteAlert ) {
m_inviteAlert.dismiss();
m_inviteAlert = null;
}
dismissInviteAlert();
Log.d( TAG, "recordInviteSent(): redoing invite alert" );
showInviteAlertIf();
}