aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-01-30 23:32:36 -0800
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-01-30 23:33:25 -0800
commitfe747d3f16ebd3485c9419f36ce940aa1df5037d (patch)
tree91eed9916ce09a178e61d62a4fe5ea5cfbe11fc4 /lib
parent452af2227f45069cb25dc86071162da0a49b9ad4 (diff)
downloadpatchfoo-fe747d3f16ebd3485c9419f36ce940aa1df5037d.tar.gz
patchfoo-fe747d3f16ebd3485c9419f36ce940aa1df5037d.zip
Catch missing ssb-fulltext
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/app.js b/lib/app.js
index de8585d..a7533ce 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -3,6 +3,7 @@ var memo = require('asyncmemo')
var lru = require('lrucache')
var pkg = require('../package')
var u = require('./util')
+var pull = require('pull-stream')
var Serve = require('./serve')
var Render = require('./render')
@@ -74,7 +75,9 @@ App.prototype.unboxMsg = function (msg, cb) {
}
App.prototype.search = function (opts) {
- return this.sbot.fulltext.search(opts)
+ var search = this.sbot.fulltext && this.sbot.fulltext.search
+ if (!search) return pull.error(new Error('Missing fulltext search plugin'))
+ return search(opts)
}
App.prototype.getMsgDecrypted = function (key, cb) {