Skip to content

Commit 77b1ff3

Browse files
author
Massimiliano Pippi
committed
result might be nil, do not marshall it
1 parent 928d9d3 commit 77b1ff3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

cli/lib/list.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ func runListCommand(cmd *cobra.Command, args []string) {
6666
}
6767

6868
libs := res.GetInstalledLibrary()
69-
70-
if globals.OutputFormat == "json" {
71-
feedback.PrintJSON(libs)
72-
} else {
73-
outputListLibrary(libs)
69+
if libs != nil {
70+
if globals.OutputFormat == "json" {
71+
feedback.PrintJSON(libs)
72+
} else {
73+
outputListLibrary(libs)
74+
}
7475
}
7576

7677
logrus.Info("Done")

0 commit comments

Comments
 (0)