am afce7ad2: Fix NPE when no pending intent was given

* commit 'afce7ad2c2c347bb30119e224cd414a9a6339060':
  Fix NPE when no pending intent was given
diff --git a/src/com/android/phone/HfaActivity.java b/src/com/android/phone/HfaActivity.java
index 3bc047d..c1753d0 100644
--- a/src/com/android/phone/HfaActivity.java
+++ b/src/com/android/phone/HfaActivity.java
@@ -225,14 +225,17 @@
         final PendingIntent otaResponseIntent = getIntent().getParcelableExtra(
                 OtaUtils.EXTRA_OTASP_RESULT_CODE_PENDING_INTENT);
 
-        final Intent extraStuff = new Intent();
-        extraStuff.putExtra(OtaUtils.EXTRA_OTASP_RESULT_CODE, responseCode);
+        if (otaResponseIntent != null) {
+            final Intent extraStuff = new Intent();
+            extraStuff.putExtra(OtaUtils.EXTRA_OTASP_RESULT_CODE, responseCode);
 
-        try {
-            if (VERBOSE) Log.v(TAG, "Sending OTASP confirmation with result code: " + responseCode);
-            otaResponseIntent.send(this, 0 /* resultCode (not used) */, extraStuff);
-        } catch (CanceledException e) {
-            Log.e(TAG, "Pending Intent canceled");
+            try {
+                if (VERBOSE) Log.v(TAG, "Sending OTASP confirmation with result code: "
+                        + responseCode);
+                otaResponseIntent.send(this, 0 /* resultCode (not used) */, extraStuff);
+            } catch (CanceledException e) {
+                Log.e(TAG, "Pending Intent canceled");
+            }
         }
 
         finish();