Skip to content

Commit 3662188

Browse files
committed
Fixed UpdateIndex regression
1 parent c6915fb commit 3662188

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

commands/instances.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,13 @@ func Init(ctx context.Context, req *rpc.InitReq) (*rpc.InitResp, error) {
8787
if inConfig.DownloadsDir != "" {
8888
config.ArduinoDownloadsDir = paths.New(inConfig.DownloadsDir)
8989
}
90-
urls := []*url.URL{}
9190
for _, rawurl := range inConfig.BoardManagerAdditionalUrls {
9291
if u, err := url.Parse(rawurl); err == nil {
93-
urls = append(urls, u)
92+
config.BoardManagerAdditionalUrls = append(config.BoardManagerAdditionalUrls, u)
9493
} else {
9594
return nil, fmt.Errorf("parsing url %s: %s", rawurl, err)
9695
}
9796
}
98-
config.BoardManagerAdditionalUrls = urls
9997

10098
pm, lm, reqPltIndex, reqLibIndex, err := createInstance(ctx, config, req.GetLibraryManagerOnly())
10199
if err != nil {

daemon/daemon.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ func (s *ArduinoCoreServerImpl) UpdateIndex(req *rpc.UpdateIndexReq, stream rpc.
8383
resp, err := commands.UpdateIndex(stream.Context(), req,
8484
func(p *rpc.DownloadProgress) { stream.Send(&rpc.UpdateIndexResp{DownloadProgress: p}) },
8585
)
86-
stream.Send(resp)
87-
return err
86+
if err != nil {
87+
return err
88+
}
89+
return stream.Send(resp)
8890
}
8991

9092
func (s *ArduinoCoreServerImpl) UpdateLibrariesIndex(req *rpc.UpdateLibrariesIndexReq, stream rpc.ArduinoCore_UpdateLibrariesIndexServer) error {

0 commit comments

Comments
 (0)