Skip to content

Commit

Permalink
fix: unexpected console error from pendo messsages in demo (#167)
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 authored Aug 25, 2023
1 parent c66936b commit af43bc3
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 af43bc3

Please sign in to comment.