Skip to content

Commit

Permalink
Merge pull request #73 from MindscapeHQ/sm/add-stringify-check-on-bre…
Browse files Browse the repository at this point in the history
…adcrumb-message

[Maintainance]: Add stringify check on breadcrumb message✔️🧹
  • Loading branch information
sumitramanga authored Oct 17, 2023
2 parents fc76024 + ebc3bb5 commit c59dcd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "raygun4reactnative",
"title": "Raygun4reactnative",
"version": "1.2.5",
"version": "1.2.6",
"description": "Raygun React Native SDK",
"main": "dist/index.js",
"typescript": {
Expand Down
8 changes: 8 additions & 0 deletions sdk/src/CrashReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ export default class CrashReporter {
* @param {Breadcrumb} breadcrumb
*/
recordBreadcrumb(breadcrumb: Breadcrumb) {

/**
Android does not seem to handle the mismatched types gracefully like how iOS does.
Therefore we need to an additional check to avoid users app from crashing
**/

breadcrumb.message = JSON.stringify(breadcrumb.message);

this.breadcrumbs.push({...breadcrumb});

if (this.breadcrumbs.length > this.maxBreadcrumbsPerErrorReport) {
Expand Down

0 comments on commit c59dcd4

Please sign in to comment.