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

Commit

Permalink
fix: allow for graceful release with datastore-level
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobheun committed Sep 19, 2018
1 parent 8fe47eb commit 64ff6a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/utils/with-mfs-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const withMfsRoot = (ipfs, callback) => {
(cb) => {
// Load the MFS root CID
datastore.get(MFS_ROOT_KEY, (error, result) => {
if (error && error.code === 'ERR_NOT_FOUND') {
// Once datastore-level releases its error.code addition, we can remove error.notFound logic
if (error && (error.notFound || error.code === 'ERR_NOT_FOUND')) {
log('Creating new MFS root')

return waterfall([
Expand Down

0 comments on commit 64ff6a1

Please sign in to comment.