Skip to content

Commit e6de840

Browse files
committed
Do not panic if discovery tool is not installed
1 parent 90b9aac commit e6de840

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arduino/cores/packagemanager/loader.go

+4
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,10 @@ func (pm *PackageManager) loadDiscoveries(release *cores.PlatformRelease) []*sta
649649
continue
650650
}
651651
toolRelease := tool.GetLatestInstalled()
652+
if toolRelease == nil {
653+
statuses = append(statuses, status.Newf(codes.FailedPrecondition, "discovery not installed: %s", id))
654+
continue
655+
}
652656
discoveryPath := toolRelease.InstallDir.Join(tool.Name).String()
653657
d, err := discovery.New(id, discoveryPath)
654658
if err != nil {

0 commit comments

Comments
 (0)