Skip to content

Commit c59dcd4

Browse files
authored
Merge pull request #73 from MindscapeHQ/sm/add-stringify-check-on-breadcrumb-message
[Maintainance]: Add stringify check on breadcrumb message✔️🧹
2 parents fc76024 + ebc3bb5 commit c59dcd4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "raygun4reactnative",
33
"title": "Raygun4reactnative",
4-
"version": "1.2.5",
4+
"version": "1.2.6",
55
"description": "Raygun React Native SDK",
66
"main": "dist/index.js",
77
"typescript": {

sdk/src/CrashReporter.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ export default class CrashReporter {
126126
* @param {Breadcrumb} breadcrumb
127127
*/
128128
recordBreadcrumb(breadcrumb: Breadcrumb) {
129+
130+
/**
131+
Android does not seem to handle the mismatched types gracefully like how iOS does.
132+
Therefore we need to an additional check to avoid users app from crashing
133+
**/
134+
135+
breadcrumb.message = JSON.stringify(breadcrumb.message);
136+
129137
this.breadcrumbs.push({...breadcrumb});
130138

131139
if (this.breadcrumbs.length > this.maxBreadcrumbsPerErrorReport) {

0 commit comments

Comments
 (0)