Fix NPE when there is no type

Stephen Paul Weber created

Change summary

src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java 🔗

@@ -273,7 +273,7 @@ public class EnterJidDialog extends DialogFragment implements OnBackendConnected
         final String type = gatewayListAdapter.getSelectedType();
 
         // Resolve based on local settings before submission
-        if (type.equals("pstn") || type.equals("sms")) {
+        if (type != null && (type.equals("pstn") || type.equals("sms"))) {
             try {
                 binding.jid.setText(PhoneNumberUtilWrapper.normalize(getActivity(), binding.jid.getText().toString()));
             } catch (NumberParseException | NullPointerException e) { }