summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2016-05-02 22:24:10 (GMT)
committerStephen Bird <sbird@cyngn.com>2016-05-04 19:52:33 (GMT)
commit5f1fb3439d16356b6c956a1e86308a1b04483c5c (patch)
tree8b77ec429e0c158af9ae9329f4d87000e23be1ed
parent5564f99a4ba3a1d449b4e978ffd54f5179d3510b (diff)
downloadandroid_packages_apps_PhoneCommon-5f1fb3439d16356b6c956a1e86308a1b04483c5c.zip
android_packages_apps_PhoneCommon-5f1fb3439d16356b6c956a1e86308a1b04483c5c.tar.gz
android_packages_apps_PhoneCommon-5f1fb3439d16356b6c956a1e86308a1b04483c5c.tar.bz2
NPE: Make sure clients have a credit warning
Change-Id: Id9e9aaaef0928dbeb1d3248d5855149f9e5cb0b3 Ticket: CD-609
-rw-r--r--src-ambient/com/android/phone/common/incall/api/InCallResults.java14
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");
}
}