Fix code for NPE when click add and cancel repeatly VPN profile
Symptom: NPE is happened when click add and cancel repeatly VPN profile Root Cause: Exception handling for ConfigDialog object Steps to reproduce : 1. Go to VPN menu in Settings without Secure LockScreen 2. Click add VPN profile button 3. Keyguard dialog show 4. Click cancel button 5. Repeat 2 - 4 step Test: refer a "Steps to reproduce" Solution: Add exception handling for ConfigDialog object. This is a very rare case. But exception handling code should be needed. Signed-off-by: SangJin Cha <sj.cha@lge.com> Change-Id: I4c680b383f94c86a1c806d986e56f9f00d2be10e
This commit is contained in:
@@ -143,6 +143,10 @@ public class ConfigDialogFragment extends InstrumentedDialogFragment implements
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int button) {
|
||||
ConfigDialog dialog = (ConfigDialog) getDialog();
|
||||
if (dialog == null) {
|
||||
Log.e(TAG, "ConfigDialog object is null");
|
||||
return;
|
||||
}
|
||||
VpnProfile profile = dialog.getProfile();
|
||||
|
||||
if (button == DialogInterface.BUTTON_POSITIVE) {
|
||||
|
Reference in New Issue
Block a user