Skip to content

Commit

Permalink
fix(add): install plugin null pointer (version-fox#370)
Browse files Browse the repository at this point in the history
Fixed missing error handling when adding plugins to vfox
  • Loading branch information
jan-bar authored Oct 13, 2024
1 parent 65ee668 commit ca4d9e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ func (m *Manager) LookupSdkWithInstall(name string) (*Sdk, error) {
Show(); result {

manifest, err := m.fetchPluginManifest(m.GetRegistryAddress(name + ".json"))
if errors.Is(err, ManifestNotFound) {
return nil, fmt.Errorf("[%s] not found in remote registry, please check the name", pterm.LightRed(name))
if err != nil {
if errors.Is(err, ManifestNotFound) {
return nil, fmt.Errorf("[%s] not found in remote registry, please check the name", pterm.LightRed(name))
}
return nil, err
}

if err = m.Add(manifest.Name, manifest.DownloadUrl, ""); err != nil {
Expand Down

0 comments on commit ca4d9e6

Please sign in to comment.