We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dff92eb commit a1759f5Copy full SHA for a1759f5
databox/client/src/components/Media/Asset/Attribute/types/JsonType.tsx
@@ -7,6 +7,11 @@ export default class JsonType extends CodeType {
7
}
8
9
protected prettifyCode(code: string): string {
10
- return JSON.stringify(JSON.parse(code), null, 2);
+ try {
11
+ return JSON.stringify(JSON.parse(code), null, 2);
12
+ } catch (e) {
13
+ console.error('Error prettifying JSON code:', e);
14
+ return code; // Return original code if parsing fails
15
+ }
16
17
0 commit comments