diff options
-rw-r--r-- | lib/app.js | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) { |