Skip to content

Commit 08fd998

Browse files
committed
fix nil pointer error
1 parent 7d6d914 commit 08fd998

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/impl/packages.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ func (d *Devbox) Add(ctx context.Context, pkgsNames ...string) error {
5858
// CanonicalName so any legacy or versioned packages will be removed if they
5959
// match.
6060
found, _ := d.findPackageByName(pkg.CanonicalName())
61-
// TODO savil: should name be found.Raw?
62-
if name := found.String(); name != "" {
61+
if found != nil {
62+
name := found.String() // TODO savil: should name be found.Raw?
6363
if err := d.Remove(ctx, name); err != nil {
6464
return err
6565
}

0 commit comments

Comments
 (0)