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).
This commit is contained in:
jsh
2009-05-20 10:52:19 -07:00
parent a5ca3425f9
commit 31fd22923a
2 changed files with 2 additions and 2 deletions

View File

@@ -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());

View File

@@ -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());
}