Skip to content

Commit

Permalink
fix: unexpected console error from pendo messsages in demo
Browse files Browse the repository at this point in the history
The embed javascript demo was rendering an unexpected error
message in the javascript console. The type of message data
is now checked prior to parsing it.
  • Loading branch information
bryans99 committed Aug 25, 2023
1 parent c66936b commit 3efa8db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo/message_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ class EmbedFrameImpl implements EmbedFrame {
if (data) {
let parsedData: any
try {
parsedData = JSON.parse(data)
parsedData = typeof data === 'object' ? data : JSON.parse(data)
} catch (error) {
console.error('data is not json', { data })
}
Expand Down

0 comments on commit 3efa8db

Please sign in to comment.