Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 2dac5eb

Browse files
committed
Default added name to multihash if no path.
1 parent 31e7c8d commit 2dac5eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/ipfs/files.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ module.exports = function files (self) {
4444

4545
// Transform file info tuples to DAGNodes
4646
i.pipe(through.obj(function transform (info, enc, next) {
47-
self._dagS.get(bs58.encode(info.multihash).toString(), (err, node) => {
47+
const mh = bs58.encode(info.multihash).toString()
48+
self._dagS.get(mh, (err, node) => {
4849
if (err) return callback(err)
4950
var obj = {
50-
path: info.path,
51+
path: info.path || mh,
5152
node: node
5253
}
5354
res.push(obj)

0 commit comments

Comments
 (0)