Avoids crashes
This commit is contained in:
parent
9d5129a9dd
commit
0e09591ce6
|
@ -1251,8 +1251,10 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
// Retrieves instance
|
||||
new RetrieveInstanceAsyncTask(getApplicationContext(), BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
// Retrieves filters
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
||||
new ManageFiltersAsyncTask(getApplicationContext(), GET_ALL_FILTER, null, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
}
|
||||
|
||||
/* Clean cache for statuses */
|
||||
AsyncTask.execute(new Runnable() {
|
||||
|
|
|
@ -245,11 +245,13 @@ public class SyncTimelinesAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
}
|
||||
}
|
||||
APIResponse apiResponse = null;
|
||||
if( MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
||||
List<app.fedilab.android.client.Entities.List> lists = null;
|
||||
try {
|
||||
apiResponse = new API(contextReference.get()).getLists();
|
||||
lists = apiResponse.getLists();
|
||||
}catch (Exception ignored){ }
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (lists != null && lists.size() > 0) {
|
||||
//Loop through results
|
||||
|
@ -299,6 +301,7 @@ public class SyncTimelinesAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
for (Iterator<ManageTimelines> it = manageTimelines.iterator(); it.hasNext();) {
|
||||
if (!it.next().isDisplayed()) {
|
||||
it.remove();
|
||||
|
|
|
@ -3151,6 +3151,7 @@ public class Helper {
|
|||
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
|
||||
.into(imageView);
|
||||
}catch (Exception e){
|
||||
try {
|
||||
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || BaseMainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
||||
Glide.with(imageView.getContext())
|
||||
.asDrawable()
|
||||
|
@ -3170,6 +3171,7 @@ public class Helper {
|
|||
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
|
||||
.into(imageView);
|
||||
}
|
||||
}catch (Exception ignored){}
|
||||
}
|
||||
}else{
|
||||
try {
|
||||
|
@ -3179,6 +3181,7 @@ public class Helper {
|
|||
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
|
||||
.into(imageView);
|
||||
}catch (Exception e){
|
||||
try {
|
||||
if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || BaseMainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA) {
|
||||
Glide.with(imageView.getContext())
|
||||
.asDrawable()
|
||||
|
@ -3198,6 +3201,7 @@ public class Helper {
|
|||
.apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(10)))
|
||||
.into(imageView);
|
||||
}
|
||||
}catch (Exception ignored){}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue