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

Commit

Permalink
Default added name to multihash if no path.
Browse files Browse the repository at this point in the history
  • Loading branch information
hackergrrl committed May 27, 2016
1 parent 31e7c8d commit 2dac5eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/ipfs/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ module.exports = function files (self) {

// Transform file info tuples to DAGNodes
i.pipe(through.obj(function transform (info, enc, next) {
self._dagS.get(bs58.encode(info.multihash).toString(), (err, node) => {
const mh = bs58.encode(info.multihash).toString()
self._dagS.get(mh, (err, node) => {
if (err) return callback(err)
var obj = {
path: info.path,
path: info.path || mh,
node: node
}
res.push(obj)
Expand Down

0 comments on commit 2dac5eb

Please sign in to comment.