Skip to content

Commit

Permalink
Hot Fix error when textMessages field is null
Browse files Browse the repository at this point in the history
  • Loading branch information
swimmingkiim committed Feb 11, 2023
1 parent 078983a commit 85da369
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions lib/gify_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ class GifyWeb extends GifyPlatform {
width: width,
height: height,
forceOriginalAspectRatio: forceOriginalAspectRatio,
textMessagesJsonString: jsonEncode(
textMessages
?.map<Map<String, dynamic>>((textMessage) => textMessage.asMap())
.toList(),
),
textMessagesJsonString: textMessages == null
? null
: jsonEncode(
textMessages
.map<Map<String, dynamic>>(
(textMessage) => textMessage.asMap())
.toList(),
),
);
return gifBytes;
}
Expand All @@ -77,11 +80,14 @@ class GifyWeb extends GifyPlatform {
width: width,
height: height,
forceOriginalAspectRatio: forceOriginalAspectRatio,
textMessagesJsonString: jsonEncode(
textMessages
?.map<Map<String, dynamic>>((textMessage) => textMessage.asMap())
.toList(),
),
textMessagesJsonString: textMessages == null
? null
: jsonEncode(
textMessages
.map<Map<String, dynamic>>(
(textMessage) => textMessage.asMap())
.toList(),
),
);
return gifBytes;
}
Expand Down

0 comments on commit 85da369

Please sign in to comment.