[app] don't show app details menu before the app and its preferences haven't been loaded

Fixes acra-crash-reports#185, acra-crash-reports#197
This commit is contained in:
Torsten Grote 2023-02-28 11:25:42 -03:00 committed by Hans-Christoph Steiner
parent cbf422a03c
commit 00b68f0442
1 changed files with 2 additions and 1 deletions

View File

@ -244,7 +244,8 @@ public class AppDetailsActivity extends AppCompatActivity
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
final AppPrefs prefs = appPrefs;
if (prefs == null) return true;
// don't show menu before appPrefs haven't been loaded
if (prefs == null || app == null) return false;
MenuItem itemIgnoreAll = menu.findItem(R.id.action_ignore_all);
itemIgnoreAll.setChecked(prefs.getIgnoreAllUpdates());