🐛 Fix null value in event body

This commit is contained in:
LittleSheep 2024-06-28 19:33:59 +08:00
parent 29a975235c
commit 424be16ab0

View File

@ -79,8 +79,8 @@ class EventMessageBody {
factory EventMessageBody.fromJson(Map<String, dynamic> json) => factory EventMessageBody.fromJson(Map<String, dynamic> json) =>
EventMessageBody( EventMessageBody(
text: json['text'], text: json['text'] ?? '',
algorithm: json['algorithm'], algorithm: json['algorithm'] ?? 'plain',
attachments: json['attachments'] != null attachments: json['attachments'] != null
? List<int>.from(json['attachments'].map((x) => x)) ? List<int>.from(json['attachments'].map((x) => x))
: null, : null,