Skip to content

Commit d50bd7b

Browse files
authored
Merge branch 'main' into fix/dup-crumbs-android
2 parents 6dacf3c + 3f0e852 commit d50bd7b

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Fixes
66

77
* Breadcrumbs should not be duplicated if there is no mechanism on Android ([#936](https://github.com/getsentry/sentry-dart/pull/936))
8+
* Maps with Key Object, Object would fail during serialization if not String, Object ([#935](https://github.com/getsentry/sentry-dart/pull/935))
89

910
## 6.6.3
1011

dart/lib/src/protocol/breadcrumb.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,17 @@ class Breadcrumb {
129129
factory Breadcrumb.fromJson(Map<String, dynamic> json) {
130130
final levelName = json['level'];
131131
final timestamp = json['timestamp'];
132+
133+
var data = json['data'];
134+
if (data != null) {
135+
data = Map<String, dynamic>.from(data as Map);
136+
}
137+
132138
return Breadcrumb(
133139
timestamp: timestamp != null ? DateTime.tryParse(timestamp) : null,
134140
message: json['message'],
135141
category: json['category'],
136-
data: json['data'],
142+
data: data,
137143
level: levelName != null ? SentryLevel.fromName(levelName) : null,
138144
type: json['type'],
139145
);

dart/lib/src/protocol/mechanism.dart

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,23 @@ class Mechanism {
7676

7777
/// Deserializes a [Mechanism] from JSON [Map].
7878
factory Mechanism.fromJson(Map<String, dynamic> json) {
79+
var data = json['data'];
80+
if (data != null) {
81+
data = Map<String, dynamic>.from(data as Map);
82+
}
83+
84+
var meta = json['meta'];
85+
if (meta != null) {
86+
meta = Map<String, dynamic>.from(meta as Map);
87+
}
88+
7989
return Mechanism(
8090
type: json['type'],
8191
description: json['description'],
8292
helpLink: json['help_link'],
8393
handled: json['handled'],
84-
meta: json['meta'],
85-
data: json['data'],
94+
meta: meta,
95+
data: data,
8696
synthetic: json['synthetic'],
8797
);
8898
}

dart/lib/src/protocol/sentry_event.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,18 @@ class SentryEvent with SentryEventLike<SentryEvent> {
275275
final requestJson = json['request'] as Map<String, dynamic>?;
276276
final debugMetaJson = json['debug_meta'] as Map<String, dynamic>?;
277277

278+
var extra = json['extra'];
279+
if (extra != null) {
280+
extra = Map<String, dynamic>.from(extra as Map);
281+
}
282+
278283
return SentryEvent(
279284
eventId: SentryId.fromId(json['event_id']),
280285
timestamp:
281286
timestampJson != null ? DateTime.tryParse(timestampJson) : null,
282287
modules: modules,
283288
tags: tags,
284-
extra: json['extra'],
289+
extra: extra,
285290
fingerprint:
286291
fingerprintJson?.map((e) => e as String).toList(growable: false),
287292
breadcrumbs: breadcrumbs,

0 commit comments

Comments
 (0)