Fix NPE when there is no type
This commit is contained in:
parent
d0c1d9d72c
commit
a607f2f20a
|
@ -273,7 +273,7 @@ public class EnterJidDialog extends DialogFragment implements OnBackendConnected
|
||||||
final String type = gatewayListAdapter.getSelectedType();
|
final String type = gatewayListAdapter.getSelectedType();
|
||||||
|
|
||||||
// Resolve based on local settings before submission
|
// Resolve based on local settings before submission
|
||||||
if (type.equals("pstn") || type.equals("sms")) {
|
if (type != null && (type.equals("pstn") || type.equals("sms"))) {
|
||||||
try {
|
try {
|
||||||
binding.jid.setText(PhoneNumberUtilWrapper.normalize(getActivity(), binding.jid.getText().toString()));
|
binding.jid.setText(PhoneNumberUtilWrapper.normalize(getActivity(), binding.jid.getText().toString()));
|
||||||
} catch (NumberParseException | NullPointerException e) { }
|
} catch (NumberParseException | NullPointerException e) { }
|
||||||
|
|
Loading…
Reference in a new issue