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 c240538 commit d979551Copy full SHA for d979551
src/utils/helpers.ts
@@ -74,12 +74,15 @@ export const renderJSON = (obj: unknown) =>
74
export const renderMaybeParsedJSON = (value: unknown): string => {
75
if (value == null) return renderJSON(value);
76
77
- if (typeof value === "object" && "message" in value && typeof (value as any).message === "string") {
+ if (
78
+ typeof value === "object" &&
79
+ value !== null &&
80
+ "message" in value &&
81
+ typeof (value as Record<string, unknown>).message === "string"
82
+ ) {
83
const obj = value as { message: string };
-
84
try {
85
const parsed = JSON.parse(obj.message);
86
return renderJSON({ ...value, message: parsed });
87
} catch {
88
return renderJSON(value);
0 commit comments