Skip to content

Commit

Permalink
Fix #300 - check if content_raw does not contain DiscussionWelcome
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrehakcz committed Feb 24, 2022
1 parent 7f1c699 commit 3ed6ed5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/model/Post.dart
Expand Up @@ -36,7 +36,9 @@ class Post {
this._canBeDeleted = json['can_be_deleted'] ?? false;
this._canBeReminded = json['can_be_reminded'] ?? false;

if (json['content_raw'] != null) {
if (json['content_raw'] != null &&
json['content_raw']['data'] != null &&
!json['content_raw']['data'].containsKey('DiscussionWelcome')) {
switch (json['content_raw']['type']) {
case 'poll':
this._content = ContentPoll.fromJson(json['content_raw']['data'], discussionId: json['discussion_id'], postId: json['id']);
Expand Down

0 comments on commit 3ed6ed5

Please sign in to comment.