aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js2
-rw-r--r--lib/serve.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/app.js b/lib/app.js
index 1c3647b..4789e11 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -295,7 +295,7 @@ App.prototype.readBlobSlice = function (link, opts) {
App.prototype.ensureHasBlobs = function (links, cb) {
var self = this
var done = multicb({pluck: 1})
- links.forEach(function (link) {
+ links.filter(Boolean).forEach(function (link) {
var cb = done()
self.sbot.blobs.size(link.link, function (err, size) {
if (err) cb(err)
diff --git a/lib/serve.js b/lib/serve.js
index 40f92a8..73e209c 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -1896,12 +1896,16 @@ Serve.prototype.gitTree = function (rev) {
headMsgId: obj.msg.key,
}, function (err, msg) {
if (err && err.name === 'ObjectNotFoundError') return cb(null, file)
+ if (err && err.name === 'BlobNotFoundError') return cb(null, {missingBlobs: err.links})
if (err) return cb(err)
file.msg = msg
cb(null, file)
})
}, 8),
pull.map(function (item) {
+ if (item.missingBlobs) {
+ return self.askWantBlobsForm(item.missingBlobs)
+ }
if (!item.msg) return ph('tr', [
ph('td',
u.escapeHTML(item.name) + (item.type === 'tree' ? '/' : '')),