Skip to content

Commit

Permalink
Merge pull request #2015 from famedly/krille/fix-push-notification-fr…
Browse files Browse the repository at this point in the history
…omjson-tojson-fails

fix: PushNotification fromJson - toJson fails
  • Loading branch information
krille-chan authored Feb 4, 2025
2 parents 3353518 + eb9bd06 commit ac77f0e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/src/utils/push_notification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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?,
Expand Down

0 comments on commit ac77f0e

Please sign in to comment.