File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
components/ide/jetbrains/launcher Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -494,8 +494,21 @@ func resolveUserEnvs(launchCtx *LaunchContext) (userEnvs []string, err error) {
494
494
return
495
495
}
496
496
markByte := []byte (mark .String ())
497
- start := bytes .Index (output , markByte ) + len (markByte )
497
+ start := bytes .Index (output , markByte )
498
+ if start == - 1 {
499
+ err = fmt .Errorf ("no %s in output" , mark .String ())
500
+ return
501
+ }
502
+ start = start + len (markByte )
503
+ if start > len (output ) {
504
+ err = fmt .Errorf ("no %s in output" , mark .String ())
505
+ return
506
+ }
498
507
end := bytes .LastIndex (output , markByte )
508
+ if end == - 1 {
509
+ err = fmt .Errorf ("no %s in output" , mark .String ())
510
+ return
511
+ }
499
512
err = json .Unmarshal (output [start :end ], & userEnvs )
500
513
return
501
514
}
You can’t perform that action at this time.
0 commit comments