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

Commit 64ff6a1

Browse files
committed
fix: allow for graceful release with datastore-level
1 parent 8fe47eb commit 64ff6a1

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
@@ -22,7 +22,8 @@ const withMfsRoot = (ipfs, callback) => {
2222
(cb) => {
2323
// Load the MFS root CID
2424
datastore.get(MFS_ROOT_KEY, (error, result) => {
25-
if (error && error.code === 'ERR_NOT_FOUND') {
25+
// Once datastore-level releases its error.code addition, we can remove error.notFound logic
26+
if (error && (error.notFound || error.code === 'ERR_NOT_FOUND')) {
2627
log('Creating new MFS root')
2728

2829
return waterfall([

0 commit comments

Comments
 (0)