Merge "Check for invalid simOperator."
diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index 185aea0..c6a1921 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -270,7 +270,8 @@
         String gid2 = "";
         String spn = TelephonyManager.from(mContext).getSimOperatorNameForPhone(phoneId);
         String simOperator = TelephonyManager.from(mContext).getSimOperatorNumericForPhone(phoneId);
-        if (simOperator != null) {
+        // A valid simOperator should be 5 or 6 digits, depending on the length of the MNC.
+        if (simOperator != null && simOperator.length() >= 3) {
             mcc = simOperator.substring(0, 3);
             mnc = simOperator.substring(3);
         }