File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -179,13 +179,21 @@ export namespace NSSentry {
179179 try {
180180 if ( breadcrumb . data ) {
181181 Object . keys ( breadcrumb . data ) . forEach ( ( k ) => {
182- const value = breadcrumb . data [ k ] ;
182+ let value = breadcrumb . data [ k ] ;
183183 // in case a `status_code` entry got accidentally stringified as a float
184- if ( k === 'status_code' ) {
185- nBreadcumb . setData ( k , value && value . endsWith ( '.0' ) ? value . replace ( '.0' , '' ) : value ) ;
186- } else {
187- nBreadcumb . setData ( k , value ) ;
184+ if ( k === 'status_code' && typeof value === 'string' && value . endsWith ( '.0' ) ) {
185+ value = value . replace ( '.0' , '' ) ;
186+ } else if ( typeof value === 'boolean' ) {
187+ value = new java . lang . Boolean ( value ) ;
188+ } else if ( typeof value === 'number' ) {
189+ value = value . toString ( ) ;
190+ } else if ( Array . isArray ( value ) ) {
191+ value = new org . json . JSONArray ( JSON . stringify ( value ) ) ;
192+ } else if ( value && typeof value === 'object' ) {
193+ value = new org . json . JSONObject ( JSON . stringify ( value ) ) ;
188194 }
195+
196+ nBreadcumb . setData ( k , value ) ;
189197 } ) ;
190198 }
191199 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments