Merge "Fix crash while trying to connect to network in WiFi Settings."
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index a4ecf0e..5c66309 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -447,7 +447,7 @@
case MENU_ID_CONNECT: {
if (mSelectedAccessPoint.isSaved()) {
connect(mSelectedAccessPoint.getConfig());
- } else if (mSelectedAccessPoint.getSecurity() != AccessPoint.SECURITY_NONE) {
+ } else if (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) {
/** Bypass dialog for unsecured networks */
mSelectedAccessPoint.generateOpenNetworkConfig();
connect(mSelectedAccessPoint.getConfig());