From fe747d3f16ebd3485c9419f36ce940aa1df5037d Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 30 Jan 2017 23:32:36 -0800 Subject: Catch missing ssb-fulltext --- lib/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3