mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-13 19:27:33 +01:00
Avoid potential, but very unlikely NPE
This commit is contained in:
parent
4622b384f2
commit
394a0905dc
@ -36,6 +36,7 @@ public class SMSReceiver extends BroadcastReceiver {
|
|||||||
Bundle bundle = intent.getExtras();
|
Bundle bundle = intent.getExtras();
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
Object[] pdus = (Object[]) bundle.get("pdus");
|
Object[] pdus = (Object[]) bundle.get("pdus");
|
||||||
|
if (pdus != null) {
|
||||||
for (Object pdu1 : pdus) {
|
for (Object pdu1 : pdus) {
|
||||||
byte[] pdu = (byte[]) pdu1;
|
byte[] pdu = (byte[]) pdu1;
|
||||||
SmsMessage message = SmsMessage.createFromPdu(pdu);
|
SmsMessage message = SmsMessage.createFromPdu(pdu);
|
||||||
@ -47,4 +48,5 @@ public class SMSReceiver extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user