Fix possible NPE when using a TextView
This commit is contained in:
parent
bc98fd69b1
commit
e314c401e7
@ -71,9 +71,10 @@ public class ConfirmReceiveSwapFragment extends Fragment implements ProgressList
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
newRepoConfig = new NewRepoConfig(getActivity(), getActivity().getIntent());
|
newRepoConfig = new NewRepoConfig(getActivity(), getActivity().getIntent());
|
||||||
if (newRepoConfig.isValidRepo()) {
|
if (newRepoConfig.isValidRepo()) {
|
||||||
((TextView) getView().findViewById(R.id.text_description)).setText(
|
TextView tv = (TextView) getView().findViewById(R.id.text_description);
|
||||||
getString(R.string.swap_confirm_connect, newRepoConfig.getHost())
|
if (tv != null) {
|
||||||
);
|
tv.setText(getString(R.string.swap_confirm_connect, newRepoConfig.getHost()));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: Show error message on screen (not in popup).
|
// TODO: Show error message on screen (not in popup).
|
||||||
// TODO: I don't think we want to continue with this at all if the repo config is invalid,
|
// TODO: I don't think we want to continue with this at all if the repo config is invalid,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user