This repository was archived by the owner on Mar 10, 2020. It is now read-only.
File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 37
37
},
38
38
"homepage" : " https://github.com/ipfs/js-ipfs-mfs#readme" ,
39
39
"devDependencies" : {
40
- "aegir" : " ^15.0 .0" ,
40
+ "aegir" : " ^15.2 .0" ,
41
41
"chai" : " ^4.1.2" ,
42
42
"detect-node" : " ^2.0.3" ,
43
43
"detect-webworker" : " ^1.0.0" ,
54
54
"debug" : " ^3.1.0" ,
55
55
"file-api" : " ~0.10.4" ,
56
56
"filereader-stream" : " ^2.0.0" ,
57
- "interface-datastore" : " ~0.4.2 " ,
57
+ "interface-datastore" : " ~0.5.0 " ,
58
58
"ipfs-unixfs" : " ~0.1.15" ,
59
59
"ipfs-unixfs-engine" : " ~0.32.1" ,
60
60
"is-pull-stream" : " ~0.0.0" ,
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ const withMfsRoot = (ipfs, callback) => {
22
22
( cb ) => {
23
23
// Load the MFS root CID
24
24
datastore . get ( MFS_ROOT_KEY , ( error , result ) => {
25
- if ( error && error . notFound ) {
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' ) ) {
26
27
log ( 'Creating new MFS root' )
27
28
28
29
return waterfall ( [
@@ -38,7 +39,8 @@ const withMfsRoot = (ipfs, callback) => {
38
39
] , cb )
39
40
}
40
41
41
- cb ( error , new CID ( result ) )
42
+ const cid = result ? new CID ( result ) : null
43
+ cb ( error , cid )
42
44
} )
43
45
} ,
44
46
// Turn the Buffer into a CID
You can’t perform that action at this time.
0 commit comments