Skip to content

Commit

Permalink
support older format
Browse files Browse the repository at this point in the history
  • Loading branch information
benjlevesque committed Apr 29, 2020
1 parent 9307436 commit 769b7d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/request-client.js/src/api/content-data-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export default class ContentDataExtension {
): any {
if (request && request.extensions && request.extensions[CONTENT_DATA_ID]) {
const rawContent = request.extensions[CONTENT_DATA_ID].values.content;
return JSON.parse(decodeURIComponent(rawContent));

if (typeof rawContent === 'string') {
return JSON.parse(decodeURIComponent(rawContent));
}
return rawContent;
}
return null;
}
Expand Down

0 comments on commit 769b7d6

Please sign in to comment.