Sotaro KARASAWA 10 лет назад
Родитель
Сommit
221851b13c
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      lib/crowi/index.js

+ 7 - 2
lib/crowi/index.js

@@ -28,7 +28,7 @@ function Crowi (rootdir, env)
   this.mailDir   = path.join(this.viewsDir, 'mail') + sep;
 
   this.config = {};
-  this.searcher = {};
+  this.searcher = null;
   this.mailer = {};
 
 
@@ -207,7 +207,12 @@ Crowi.prototype.setupSearcher = function() {
 
   return new Promise(function(resolve, reject) {
     if (searcherUri) {
-      self.searcher = new (require(path.join(self.libDir, 'util', 'search')))(self, searcherUri);
+      try {
+        self.searcher = new (require(path.join(self.libDir, 'util', 'search')))(self, searcherUri);
+      } catch (e) {
+        debug('Error on setup searcher', e);
+        self.searcher = null;
+      }
     }
     resolve();
   });