Don't fail on bad network type input. Log it.

git-svn-id: https://zxing.googlecode.com/svn/trunk@2268 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-04-26 18:22:57 +00:00
parent a23a2b8adb
commit 9de4dd7256

View file

@ -68,7 +68,13 @@ public final class WifiConfigManager {
count++;
}
}
NetworkType networkType = NetworkType.forIntentValue(networkTypeString);
NetworkType networkType;
try {
networkType = NetworkType.forIntentValue(networkTypeString);
} catch (IllegalArgumentException iae) {
Log.w(TAG, "Bad network type; see NetworkType values: " + networkTypeString);
return;
}
if (networkType == NetworkType.NO_PASSWORD) {
changeNetworkUnEncrypted(wifiManager, ssid);
} else {