diff --git a/android/src/com/google/zxing/client/android/wifi/WifiConfigManager.java b/android/src/com/google/zxing/client/android/wifi/WifiConfigManager.java index fdae566a7..f8bf1069a 100644 --- a/android/src/com/google/zxing/client/android/wifi/WifiConfigManager.java +++ b/android/src/com/google/zxing/client/android/wifi/WifiConfigManager.java @@ -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 {