mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-13 03:37:11 +01:00
Fix crash when opening links
This commit fixes the issue where opening links while browsing would trigger an account switch with a null name.
This commit is contained in:
parent
de92e0edd3
commit
4ccb1a38bf
@ -224,7 +224,7 @@ public class LinkResolverActivity extends AppCompatActivity {
|
|||||||
intent.putExtra(ViewPostDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
|
intent.putExtra(ViewPostDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
if (mAccountQualifedName == null || !mAccountQualifedName.equals(newAccountName)) {
|
if (mAccountQualifedName == null || newAccountName != null && !mAccountQualifedName.equals(newAccountName)) {
|
||||||
SwitchAccount.switchAccount(mRedditDataRoomDatabase, mRetrofit, mCurrentAccountSharedPreferences,
|
SwitchAccount.switchAccount(mRedditDataRoomDatabase, mRetrofit, mCurrentAccountSharedPreferences,
|
||||||
mExecutor, new Handler(), newAccountName, newAccount -> {
|
mExecutor, new Handler(), newAccountName, newAccount -> {
|
||||||
EventBus.getDefault().post(new SwitchAccountEvent(getClass().getName()));
|
EventBus.getDefault().post(new SwitchAccountEvent(getClass().getName()));
|
||||||
@ -259,7 +259,7 @@ public class LinkResolverActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (mAccountQualifedName == null || !mAccountQualifedName.equals(newAccountName)) {
|
if (mAccountQualifedName == null || newAccountName != null && !mAccountQualifedName.equals(newAccountName)) {
|
||||||
SwitchAccount.switchAccount(mRedditDataRoomDatabase, mRetrofit, mCurrentAccountSharedPreferences,
|
SwitchAccount.switchAccount(mRedditDataRoomDatabase, mRetrofit, mCurrentAccountSharedPreferences,
|
||||||
mExecutor, new Handler(), newAccountName, newAccount -> {
|
mExecutor, new Handler(), newAccountName, newAccount -> {
|
||||||
EventBus.getDefault().post(new SwitchAccountEvent(getClass().getName()));
|
EventBus.getDefault().post(new SwitchAccountEvent(getClass().getName()));
|
||||||
|
Loading…
Reference in New Issue
Block a user