qri-io / dataset

qri dataset definition
MIT License
15 stars 8 forks source link

fix(`dataset.BodyFile`): if no dataset exists, return nil #251

Closed ramfox closed 3 years ago

ramfox commented 3 years ago

Might make sense to expand this beyond just dataset.BodyFile().

This was causing a bug in startf, where if this was there was no previous version of a dataset, ds.get_body would segfault. It was relying on dataset.BodyFile(), which, if there was no dataset, would segfault b/c of a nil pointer dereference.

Again, might be beneficial to expand this for all the dataset methods.