Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 59bcf3c

Browse files
committed
fix: avoid creating a cid with a null result
1 parent 62212c4 commit 59bcf3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/utils/with-mfs-root.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ const withMfsRoot = (ipfs, callback) => {
3838
], cb)
3939
}
4040

41-
cb(error, new CID(result))
41+
const cid = result ? new CID(result) : null
42+
cb(error, cid)
4243
})
4344
},
4445
// Turn the Buffer into a CID

0 commit comments

Comments
 (0)