Add nullability check on description [skip ci]

This commit is contained in:
Omar Hatem 2023-02-14 15:17:28 +02:00 committed by GitHub
parent 7235d8c9c2
commit f77a9592b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ class TwitterUser {
id: json['data']['id'] as String,
username: json['data']['username'] as String,
name: json['data']['name'] as String,
description: json['data']['description'] as String,
description: json['data']['description'] as String? ?? '',
tweets: json['includes'] != null
? List.from(json['includes']['tweets'] as List)
.map((e) => Tweet.fromJson(e as Map<String, dynamic>))