diff options
author | Stephen Bird <sbird@cyngn.com> | 2016-05-02 15:24:10 -0700 |
---|---|---|
committer | Stephen Bird <sbird@cyngn.com> | 2016-05-04 14:01:15 -0700 |
commit | ec71f07eb36a05f1629804364d14eccc6566b022 (patch) | |
tree | b4eaf87aa57b4189fea0ab19028e89eb3277f112 | |
parent | a4564a7a14caf8d6c0912947737c688a68f7c421 (diff) | |
download | packages_apps_PhoneCommon-ec71f07eb36a05f1629804364d14eccc6566b022.tar.gz packages_apps_PhoneCommon-ec71f07eb36a05f1629804364d14eccc6566b022.tar.bz2 packages_apps_PhoneCommon-ec71f07eb36a05f1629804364d14eccc6566b022.zip |
NPE: Make sure clients have a credit warning
Change-Id: Id9e9aaaef0928dbeb1d3248d5855149f9e5cb0b3
Ticket: CD-609
(cherry picked from commit 5f1fb3439d16356b6c956a1e86308a1b04483c5c)
-rw-r--r-- | src-ambient/com/android/phone/common/incall/api/InCallResults.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src-ambient/com/android/phone/common/incall/api/InCallResults.java b/src-ambient/com/android/phone/common/incall/api/InCallResults.java index 63655c3..a0286df 100644 --- a/src-ambient/com/android/phone/common/incall/api/InCallResults.java +++ b/src-ambient/com/android/phone/common/incall/api/InCallResults.java @@ -259,12 +259,16 @@ public class InCallResults extends ApiHelper { private static void gotCreditWarn(CallMethodInfo callMethodInfo, Bundle bundle) { Object creditWarn = bundle.get(NudgeKey.INCALL_PARAM_CREDIT_WARN); - if (creditWarn.getClass().equals(Integer.class)) { - callMethodInfo.mCreditWarn = (Integer) creditWarn; - } else if (creditWarn.getClass().equals(Float.class)) { - callMethodInfo.mCreditWarn = (Float) creditWarn; + if (creditWarn != null) { + if (creditWarn.getClass().equals(Integer.class)) { + callMethodInfo.mCreditWarn = (Integer) creditWarn; + } else if (creditWarn.getClass().equals(Float.class)) { + callMethodInfo.mCreditWarn = (Float) creditWarn; + } else { + Log.e(TAG, "Invalid value for Credit Warn limit: " + creditWarn); + } } else { - Log.e(TAG, "Invalid value for Credit Warn limit: " + creditWarn); + Log.e(TAG, "No credit warn limit"); } } |