Merge "Fix code for NPE when click add and cancel repeatly VPN profile"

This commit is contained in:
Treehugger Robot
2019-04-09 17:46:23 +00:00
committed by Gerrit Code Review

View File

@@ -143,6 +143,10 @@ public class ConfigDialogFragment extends InstrumentedDialogFragment implements
@Override @Override
public void onClick(DialogInterface dialogInterface, int button) { public void onClick(DialogInterface dialogInterface, int button) {
ConfigDialog dialog = (ConfigDialog) getDialog(); ConfigDialog dialog = (ConfigDialog) getDialog();
if (dialog == null) {
Log.e(TAG, "ConfigDialog object is null");
return;
}
VpnProfile profile = dialog.getProfile(); VpnProfile profile = dialog.getProfile();
if (button == DialogInterface.BUTTON_POSITIVE) { if (button == DialogInterface.BUTTON_POSITIVE) {