Skip to content

Commit 75215be

Browse files
committed
fix(dsfs): LoadDataset using the mux filesystem. Error if nil
1 parent 346c47b commit 75215be

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

base/dsfs/dataset.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ var (
3737
// LoadDataset reads a dataset from a cafs and dereferences structure, transform, and commitMsg if they exist,
3838
// returning a fully-hydrated dataset
3939
func LoadDataset(ctx context.Context, store qfs.Filesystem, path string) (*dataset.Dataset, error) {
40+
if store == nil {
41+
return nil, fmt.Errorf("loading dataset: store is nil")
42+
}
43+
4044
log.Debugf("LoadDataset path=%q", path)
4145
// set a timeout to handle long-lived requests when connected to IPFS.
4246
// if we don't have the dataset locally, IPFS will reach out onto the d.web to

lib/load.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (inst *Instance) loadLocalDataset(ctx context.Context, ref dsref.Ref) (*dat
6464
}
6565
} else {
6666
// Load from dsfs
67-
if ds, err = dsfs.LoadDataset(ctx, inst.qfs.DefaultWriteFS(), ref.Path); err != nil {
67+
if ds, err = dsfs.LoadDataset(ctx, inst.qfs, ref.Path); err != nil {
6868
return nil, err
6969
}
7070
}

0 commit comments

Comments
 (0)