1
mirror of https://github.com/rclone/rclone synced 2024-11-28 06:41:41 +01:00

about: fix crash if backend returns a nil usage

This commit is contained in:
Nick Craig-Wood 2019-05-09 14:29:31 +01:00
parent 7d70e92664
commit 9950bb9b7c

View File

@ -95,6 +95,9 @@ Use the --json flag for a computer readable output, eg
if err != nil { if err != nil {
return errors.Wrap(err, "About call failed") return errors.Wrap(err, "About call failed")
} }
if u == nil {
return errors.New("nil usage returned")
}
if jsonOutput { if jsonOutput {
out := json.NewEncoder(os.Stdout) out := json.NewEncoder(os.Stdout)
out.SetIndent("", "\t") out.SetIndent("", "\t")