Skip to content

Commit 17338f5

Browse files
committed
Fix json parse error
1 parent da3bf4b commit 17338f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WKJavaScriptController/WKJavaScriptController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ extension WKJavaScriptController: WKScriptMessageHandler {
305305
}
306306
} else if let string = arg as? String,
307307
let data = string.data(using: .utf8),
308-
let json = try? JSONSerialization.jsonObject(with: data, options: []) {
308+
let json = try? JSONSerialization.jsonObject(with: data, options: [.allowFragments]) {
309309
return json as Arg
310310
}
311311
return arg

0 commit comments

Comments
 (0)