File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,11 @@ const parseDoubleEncodedJson = (obj: any): any => {
228228}
229229
230230const highlightCode = (json ) => {
231+ if (! json ) {
232+ successResponseBody .value = ' '
233+ return
234+ }
235+
231236 if (json .error ) {
232237 // Parse double-encoded JSON error messages to display them cleanly
233238 const errorObj = parseDoubleEncodedJson (json .error )
@@ -236,14 +241,12 @@ const highlightCode = (json) => {
236241 successResponseBody .value = hljs .lineNumbersValue (
237242 hljs .highlightAuto (JSON .stringify (errorObj , null , 4 ), [' JSON' ]).value
238243 )
239- } else if ( json ) {
244+ } else {
240245 // Parse double-encoded JSON in successful responses too
241246 const parsedJson = parseDoubleEncodedJson (json )
242247 successResponseBody .value = hljs .lineNumbersValue (
243248 hljs .highlightAuto (JSON .stringify (parsedJson , null , 4 ), [' JSON' ]).value
244249 )
245- } else {
246- successResponseBody .value = ' '
247250 }
248251}
249252const submitEntitlement = async () => {
You can’t perform that action at this time.
0 commit comments