1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-28 19:45:50 +01:00

Core: handle null-body notifications

This commit is contained in:
Daniel Dakhno 2024-08-22 20:42:17 +02:00
parent 701aa99fa1
commit f19782ef55

View File

@ -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<NotificationSpec.Action>) intentCopy.getSerializableExtra(EXTRA_NOTIFICATION_ACTIONS);