Crash fixes

This commit is contained in:
Grishka 2022-04-20 22:38:20 +03:00
parent 5eb5a42465
commit 1ee55a643e
2 changed files with 9 additions and 5 deletions

View File

@ -547,8 +547,10 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
.setCallback(new Callback<>(){ .setCallback(new Callback<>(){
@Override @Override
public void onSuccess(List<Relationship> result){ public void onSuccess(List<Relationship> result){
relationship=result.get(0); if(!result.isEmpty()){
updateRelationship(); relationship=result.get(0);
updateRelationship();
}
} }
@Override @Override

View File

@ -401,9 +401,11 @@ public class InstanceCatalogFragment extends BaseRecyclerFragment<CatalogInstanc
instanceProgressDialog=new ProgressDialog(getActivity()); instanceProgressDialog=new ProgressDialog(getActivity());
instanceProgressDialog.setMessage(getString(R.string.loading_instance)); instanceProgressDialog.setMessage(getString(R.string.loading_instance));
instanceProgressDialog.setOnCancelListener(dialog->{ instanceProgressDialog.setOnCancelListener(dialog->{
loadingInstanceRequest.cancel(); if(loadingInstanceRequest!=null){
loadingInstanceRequest=null; loadingInstanceRequest.cancel();
loadingInstanceDomain=null; loadingInstanceRequest=null;
loadingInstanceDomain=null;
}
}); });
instanceProgressDialog.show(); instanceProgressDialog.show();
} }