From eb9bd0620f77c16550ca4870512521496fd5a16e Mon Sep 17 00:00:00 2001 From: Krille Date: Mon, 3 Feb 2025 11:30:50 +0100 Subject: [PATCH] fix: PushNotification fromJson - toJson fails --- lib/src/utils/push_notification.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/utils/push_notification.dart b/lib/src/utils/push_notification.dart index 279b3c85..42e29e0d 100644 --- a/lib/src/utils/push_notification.dart +++ b/lib/src/utils/push_notification.dart @@ -50,9 +50,11 @@ class PushNotification { ? (json['devices'] as List) .map((d) => PushNotificationDevice.fromJson(d)) .toList() - : (jsonDecode(json['devices'] as String) as List) - .map((d) => PushNotificationDevice.fromJson(d)) - .toList(), + : json['devices'] is String + ? (jsonDecode(json['devices'] as String) as List) + .map((d) => PushNotificationDevice.fromJson(d)) + .toList() + : null, eventId: json['event_id'] as String?, prio: json['prio'] as String?, roomAlias: json['room_alias'] as String?,