From 31fd22923aaefc85652a5b5939c6d4aa6fa289e2 Mon Sep 17 00:00:00 2001 From: jsh Date: Wed, 20 May 2009 10:52:19 -0700 Subject: Make sure smsHeader != null before using it. Fixes bug 1866578 - NPE while trying to dispatch a non-concatenated SMS with no user data header (ie, your typical SMS). --- .../java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java | 2 +- telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java index 2bb17e4..a3d00d7 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java @@ -138,7 +138,7 @@ final class CdmaSMSDispatcher extends SMSDispatcher { byte[][] pdus = new byte[1][]; pdus[0] = sms.getPdu(); - if (smsHeader.portAddrs != null) { + if (smsHeader != null && smsHeader.portAddrs != null) { if (smsHeader.portAddrs.destPort == SmsHeader.PORT_WAP_PUSH) { // GSM-style WAP indication mWapPush.dispatchWapPdu(sms.getUserData()); diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java b/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java index 2fce188..699142a 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java @@ -122,7 +122,7 @@ final class GsmSMSDispatcher extends SMSDispatcher { byte[][] pdus = new byte[1][]; pdus[0] = sms.getPdu(); - if (smsHeader.portAddrs != null) { + if (smsHeader != null && smsHeader.portAddrs != null) { if (smsHeader.portAddrs.destPort == SmsHeader.PORT_WAP_PUSH) { mWapPush.dispatchWapPdu(sms.getUserData()); } -- cgit v1.1