Skip to content

Commit

Permalink
fix(dsfs): LoadDataset using the mux filesystem. Error if nil
Browse files Browse the repository at this point in the history
  • Loading branch information
dustmop committed Jan 15, 2021
1 parent 346c47b commit 75215be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions base/dsfs/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ var (
// LoadDataset reads a dataset from a cafs and dereferences structure, transform, and commitMsg if they exist,
// returning a fully-hydrated dataset
func LoadDataset(ctx context.Context, store qfs.Filesystem, path string) (*dataset.Dataset, error) {
if store == nil {
return nil, fmt.Errorf("loading dataset: store is nil")
}

log.Debugf("LoadDataset path=%q", path)
// set a timeout to handle long-lived requests when connected to IPFS.
// if we don't have the dataset locally, IPFS will reach out onto the d.web to
Expand Down
2 changes: 1 addition & 1 deletion lib/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (inst *Instance) loadLocalDataset(ctx context.Context, ref dsref.Ref) (*dat
}
} else {
// Load from dsfs
if ds, err = dsfs.LoadDataset(ctx, inst.qfs.DefaultWriteFS(), ref.Path); err != nil {
if ds, err = dsfs.LoadDataset(ctx, inst.qfs, ref.Path); err != nil {
return nil, err
}
}
Expand Down

0 comments on commit 75215be

Please sign in to comment.