diff --git a/lib/search-index/index.js b/lib/search-index/index.js
index <HASH>..<HASH> 100644
--- a/lib/search-index/index.js
+++ b/lib/search-index/index.js
@@ -24,7 +24,7 @@ exports.init = function(options) {
 
   stats = fs.existsSync(home);
   // Is it a directory?
-  if (!stats.isDirectory()) {
+  if (!stats || !stats.isDirectory()) {
       fs.mkdirSync(home);
   }
make sure stats is not falsy