mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
Null checks. Fixes https://github.com/austinhuang0131/barinsta/issues/992
This commit is contained in:
parent
1fdd9077d5
commit
f570ea6146
@ -88,13 +88,17 @@ public class MorePreferencesFragment extends BasePreferencesFragment {
|
|||||||
public void onSuccess(@NonNull final List<Account> accounts) {
|
public void onSuccess(@NonNull final List<Account> accounts) {
|
||||||
if (!isLoggedIn) {
|
if (!isLoggedIn) {
|
||||||
if (accounts.size() > 0) {
|
if (accounts.size() > 0) {
|
||||||
accountCategory.addPreference(getAccountSwitcherPreference(null, context));
|
final AccountSwitcherPreference preference = getAccountSwitcherPreference(null, context);
|
||||||
|
if (preference == null) return;
|
||||||
|
accountCategory.addPreference(preference);
|
||||||
}
|
}
|
||||||
// Need to show something to trigger login activity
|
// Need to show something to trigger login activity
|
||||||
accountCategory.addPreference(getPreference(R.string.add_account, R.drawable.ic_add, preference -> {
|
final Preference preference1 = getPreference(R.string.add_account, R.drawable.ic_add, preference -> {
|
||||||
startActivityForResult(new Intent(getContext(), Login.class), Constants.LOGIN_RESULT_CODE);
|
startActivityForResult(new Intent(getContext(), Login.class), Constants.LOGIN_RESULT_CODE);
|
||||||
return true;
|
return true;
|
||||||
}));
|
});
|
||||||
|
if (preference1 == null) return;
|
||||||
|
accountCategory.addPreference(preference1);
|
||||||
}
|
}
|
||||||
if (accounts.size() > 0) {
|
if (accounts.size() > 0) {
|
||||||
accountCategory
|
accountCategory
|
||||||
|
Loading…
Reference in New Issue
Block a user