From f19782ef557514b053fc604b9597ea1d2a723f8d Mon Sep 17 00:00:00 2001 From: Daniel Dakhno Date: Thu, 22 Aug 2024 20:42:17 +0200 Subject: [PATCH] Core: handle null-body notifications --- .../gadgetbridge/service/DeviceCommunicationService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java index 00818b8ea..5e70dd55a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceCommunicationService.java @@ -836,8 +836,14 @@ public class DeviceCommunicationService extends Service implements SharedPrefere notificationSpec.sender = intentCopy.getStringExtra(EXTRA_NOTIFICATION_SENDER); notificationSpec.subject = intentCopy.getStringExtra(EXTRA_NOTIFICATION_SUBJECT); notificationSpec.title = intentCopy.getStringExtra(EXTRA_NOTIFICATION_TITLE); + if(notificationSpec.title == null) { + notificationSpec.title = ""; + } notificationSpec.key = intentCopy.getStringExtra(EXTRA_NOTIFICATION_KEY); notificationSpec.body = intentCopy.getStringExtra(EXTRA_NOTIFICATION_BODY); + if(notificationSpec.body == null) { + notificationSpec.body = ""; + } notificationSpec.sourceName = intentCopy.getStringExtra(EXTRA_NOTIFICATION_SOURCENAME); notificationSpec.type = (NotificationType) intentCopy.getSerializableExtra(EXTRA_NOTIFICATION_TYPE); notificationSpec.attachedActions = (ArrayList) intentCopy.getSerializableExtra(EXTRA_NOTIFICATION_ACTIONS);