Skip to content

Commit d62d015

Browse files
committed
fix: handle undefined cid
1 parent 34a2c4d commit d62d015

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Saturn {
3636
* @returns {Promise<object>}
3737
*/
3838
async fetchCID (cidPath, opts = {}) {
39-
const [cid] = cidPath.split('/')
39+
const [cid] = (cidPath ?? '').split('/')
4040
CID.parse(cid)
4141

4242
const options = Object.assign({}, this.opts, { format: 'car' }, opts)

0 commit comments

Comments
 (0)