Skip to content

Commit

Permalink
fix(p2p): dag MissingManifest sigfaults if there is a nil manifest
Browse files Browse the repository at this point in the history
guard against a nil manifest & return an error
  • Loading branch information
ramfox committed Mar 24, 2021
1 parent c7a65e8 commit 04ec5b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func PrintProgressBarsOnEvents(w io.Writer, bus event.Bus) {
progress := map[string]*mpb.Bar{}

if bus == nil {
log.Errorf("event bus is nil")
log.Debugf("event bus is nil")
return
}
// wire up a subscription to print download progress to streams
Expand Down
3 changes: 3 additions & 0 deletions p2p/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ func (node *QriNode) NewManifest(ctx context.Context, path string) (*dag.Manifes
// MissingManifest returns a manifest describing blocks that are not in this
// node for a given manifest
func (node *QriNode) MissingManifest(ctx context.Context, m *dag.Manifest) (missing *dag.Manifest, err error) {
if m == nil {
return nil, fmt.Errorf("nil manifest")
}
ng, err := newNodeGetter(node)
if err != nil {
return nil, err
Expand Down

0 comments on commit 04ec5b2

Please sign in to comment.