Skip to content

Commit 2b47068

Browse files
committed
Use temp variable to enable comipler non-null check
1 parent 9dcfb5c commit 2b47068

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dart/lib/src/sentry_envelope_item_header.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ class SentryEnvelopeItemHeader {
1818
/// Item header encoded as JSON
1919
Future<Map<String, dynamic>> toJson() async {
2020
final json = <String, dynamic>{};
21-
if (contentType != null) {
22-
json['content_type'] = contentType!;
21+
final tempContentType = contentType;
22+
if (tempContentType != null) {
23+
json['content_type'] = tempContentType;
2324
}
2425
json['type'] = type.toStringValue();
2526
json['length'] = await length();

0 commit comments

Comments
 (0)