Commit 8e993663 authored by Geoffrey Métais's avatar Geoffrey Métais

Prevent NPE

parent 69cd9a50
......@@ -121,6 +121,7 @@ public class NetworkServerDialog extends DialogFragment implements AdapterView.O
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (mUri != null) {
mEditAddress.setText(mUri.getHost());
if (!TextUtils.isEmpty(mUri.getUserInfo()))
mEditUsername.setText(mUri.getUserInfo());
......@@ -134,6 +135,7 @@ public class NetworkServerDialog extends DialogFragment implements AdapterView.O
int port = mUri.getPort();
mEditPort.setText(port != -1 ? String.valueOf(port) : getPortForProtocol(position));
}
}
private void saveServer() {
String name = (TextUtils.isEmpty(mEditServername.getText().toString())) ?
mEditAddress.getText().toString() : mEditServername.getText().toString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment