Commit 1e825c01 authored by Cristian Maglie's avatar Cristian Maglie

Fixed nil pointer if lib already downloaded

parent 59cc7b71
......@@ -77,10 +77,14 @@ func downloadLibraries(lm *librariesmanager.LibrariesManager, libReleases []*lib
formatter.PrintError(err, "Error downloading "+libRelease.String())
os.Exit(commands.ErrNetwork)
}
formatter.DownloadProgressBar(d, libRelease.String())
if d.Error() != nil {
formatter.PrintError(d.Error(), "Error downloading "+libRelease.String())
os.Exit(commands.ErrNetwork)
if d == nil {
formatter.Print(libRelease.String() + " already downloaded")
} else {
formatter.DownloadProgressBar(d, libRelease.String())
if d.Error() != nil {
formatter.PrintError(d.Error(), "Error downloading "+libRelease.String())
os.Exit(commands.ErrNetwork)
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment