diff --git a/cmd/print.go b/cmd/print.go index 827ef8552..efc6de9e8 100644 --- a/cmd/print.go +++ b/cmd/print.go @@ -244,6 +244,10 @@ func PrintProgressBarsOnEvents(w io.Writer, bus event.Bus) { p := mpb.New(mpb.WithWidth(80), mpb.WithOutput(w)) progress := map[string]*mpb.Bar{} + if bus == nil { + log.Errorf("event bus is nil") + return + } // wire up a subscription to print download progress to streams bus.SubscribeTypes(func(_ context.Context, e event.Event) error { lock.Lock() diff --git a/cmd/qri.go b/cmd/qri.go index 67844ec42..deaff5f0f 100644 --- a/cmd/qri.go +++ b/cmd/qri.go @@ -167,6 +167,10 @@ func (o *QriOptions) Init() (err error) { // being false also disables progress bars, which may be what we want (ahem: TTY // detection), but even if so, isn't the right use of this variable name if shouldColorOutput { + // TODO(ramfox): we guard for a nil bus in `PrintProgressBarsOnEvents` + // but noting here that no requests that go through http rpc will have + // a working bus, so we won't get any progress bars when working over + // http rpc until this is adjusted (once we get the events "rpc-ified") PrintProgressBarsOnEvents(o.IOStreams.ErrOut, o.inst.Bus()) }