File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -758,7 +758,13 @@ export class WKScriptMessageHandlerNotaImpl extends NSObject implements WKScript
758
758
759
759
try {
760
760
const message = JSON . parse ( webViewMessage . body as string ) ;
761
- owner . onWebViewEvent ( message . eventName , JSON . parse ( message . data ) ) ;
761
+
762
+ try {
763
+ owner . onWebViewEvent ( message . eventName , JSON . parse ( message . data ) ) ;
764
+ } catch ( err ) {
765
+ owner . writeTrace ( `userContentControllerDidReceiveScriptMessage(${ userContentController } , ${ webViewMessage } ) - couldn't parse data: ${ message . data } ` , Trace . messageType . error ) ;
766
+ owner . onWebViewEvent ( message . eventName , message . data ) ;
767
+ }
762
768
} catch ( err ) {
763
769
owner . writeTrace ( `userContentControllerDidReceiveScriptMessage(${ userContentController } , ${ webViewMessage } ) - bad message: ${ webViewMessage . body } ` , Trace . messageType . error ) ;
764
770
}
You can’t perform that action at this time.
0 commit comments