File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,14 @@ export class db2ContextProvider implements IContextProvider {
40
40
return currentJob ?. job . options . libraries [ 0 ] || "QGPL" ;
41
41
} ;
42
42
43
+ tryParseJson ( row : SelfCodeNode ) {
44
+ try {
45
+ return JSON . parse ( row . INITIAL_STACK as unknown as string ) ;
46
+ } catch ( e ) {
47
+ return [ ] ;
48
+ }
49
+ }
50
+
43
51
async getSelfCodes ( selected : JobInfo ) : Promise < SelfCodeNode [ ] | undefined > {
44
52
const current_job = selected . job . id ;
45
53
const content = `
@@ -80,7 +88,7 @@ export class db2ContextProvider implements IContextProvider {
80
88
if ( result . success ) {
81
89
const data : SelfCodeNode [ ] = result . data . map ( ( row ) => ( {
82
90
...row ,
83
- INITIAL_STACK : JSON . parse ( row . INITIAL_STACK as unknown as string ) ,
91
+ INITIAL_STACK : this . tryParseJson ( row ) ,
84
92
} ) ) ;
85
93
86
94
return data ;
You can’t perform that action at this time.
0 commit comments