Merge pull request #2015 from famedly/krille/fix-push-notification-fromjson-tojson-fails

fix: PushNotification fromJson - toJson fails
This commit is contained in:
Krille-chan 2025-02-04 09:26:26 +01:00 committed by GitHub
commit ac77f0e0bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -50,9 +50,11 @@ class PushNotification {
? (json['devices'] as List) ? (json['devices'] as List)
.map((d) => PushNotificationDevice.fromJson(d)) .map((d) => PushNotificationDevice.fromJson(d))
.toList() .toList()
: (jsonDecode(json['devices'] as String) as List) : json['devices'] is String
.map((d) => PushNotificationDevice.fromJson(d)) ? (jsonDecode(json['devices'] as String) as List)
.toList(), .map((d) => PushNotificationDevice.fromJson(d))
.toList()
: null,
eventId: json['event_id'] as String?, eventId: json['event_id'] as String?,
prio: json['prio'] as String?, prio: json['prio'] as String?,
roomAlias: json['room_alias'] as String?, roomAlias: json['room_alias'] as String?,