1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-04 03:52:02 +02:00

Prevent NPE in notification filter code

Closes #1984
This commit is contained in:
Andreas Shimokawa 2020-08-18 15:58:18 +02:00
parent 715fb67859
commit c800a18a46

View File

@ -352,11 +352,12 @@ public class NotificationListener extends NotificationListenerService {
dissectNotificationTo(notification, notificationSpec, preferBigText);
if (!checkNotificationContentForWhiteAndBlackList(sbn.getPackageName().toLowerCase(), notificationSpec.body)) {
return;
if (notificationSpec.body != null) {
if (!checkNotificationContentForWhiteAndBlackList(sbn.getPackageName().toLowerCase(), notificationSpec.body)) {
return;
}
}
// ignore Gadgetbridge's very own notifications, except for those from the debug screen
if (getApplicationContext().getPackageName().equals(source)) {
if (!getApplicationContext().getString(R.string.test_notification).equals(notificationSpec.title)) {