NPE fix in InboundSmsHandler.

Bug: 16445149

Change-Id: I79cd51d39442fe27ff07b58d04ab35c00a6dacb2
diff --git a/src/java/com/android/internal/telephony/InboundSmsHandler.java b/src/java/com/android/internal/telephony/InboundSmsHandler.java
index 74bb63a..4643677 100644
--- a/src/java/com/android/internal/telephony/InboundSmsHandler.java
+++ b/src/java/com/android/internal/telephony/InboundSmsHandler.java
@@ -46,6 +46,7 @@
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 
+import com.android.internal.telephony.uicc.UiccCard;
 import com.android.internal.telephony.uicc.UiccController;
 import com.android.internal.util.HexDump;
 import com.android.internal.util.State;
@@ -718,9 +719,12 @@
         }
 
         Intent intent = new Intent(Intents.SMS_FILTER_ACTION);
-        String carrierPackage =
-            UiccController.getInstance().getUiccCard().getCarrierPackageNameForBroadcastIntent(
-                mContext.getPackageManager(), intent);
+        String carrierPackage = null;
+        UiccCard card = UiccController.getInstance().getUiccCard();
+        if (card != null) {
+            carrierPackage = card.getCarrierPackageNameForBroadcastIntent(
+                    mContext.getPackageManager(), intent);
+        }
         if (carrierPackage != null) {
             intent.setPackage(carrierPackage);
             intent.putExtra("destport", destPort);