Skip to content

Commit 1e825c0

Browse files
committed
Fixed nil pointer if lib already downloaded
1 parent 59cc7b7 commit 1e825c0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Diff for: commands/lib/download.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ func downloadLibraries(lm *librariesmanager.LibrariesManager, libReleases []*lib
7777
formatter.PrintError(err, "Error downloading "+libRelease.String())
7878
os.Exit(commands.ErrNetwork)
7979
}
80-
formatter.DownloadProgressBar(d, libRelease.String())
81-
if d.Error() != nil {
82-
formatter.PrintError(d.Error(), "Error downloading "+libRelease.String())
83-
os.Exit(commands.ErrNetwork)
80+
if d == nil {
81+
formatter.Print(libRelease.String() + " already downloaded")
82+
} else {
83+
formatter.DownloadProgressBar(d, libRelease.String())
84+
if d.Error() != nil {
85+
formatter.PrintError(d.Error(), "Error downloading "+libRelease.String())
86+
os.Exit(commands.ErrNetwork)
87+
}
8488
}
8589
}
8690

0 commit comments

Comments
 (0)