From 1fd296f3183e19dade1605e54f3de66b34b25b62 Mon Sep 17 00:00:00 2001 From: Joe Biellik Date: Thu, 8 Sep 2016 15:33:17 +0100 Subject: [PATCH] Cleanup --- db.js | 1 + public/main.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/db.js b/db.js index ace3776..3390366 100644 --- a/db.js +++ b/db.js @@ -3,6 +3,7 @@ var util = require('util'); var mongoose = require('mongoose'); module.exports = function () { + mongoose.Promise = global.Promise; mongoose.connect(config.db); mongoose.connection.once('open', function () { diff --git a/public/main.js b/public/main.js index 20dabe9..fd66621 100644 --- a/public/main.js +++ b/public/main.js @@ -24,7 +24,7 @@ $(document).ready(function() { $(window).on('hashchange', function() { var value = location.hash.slice(1); - if ($('select#highlight option[value=' + value + ']').length) { + if (value && $('select#highlight option[value=' + value + ']').length) { $('select#highlight').val(value); } else { $('select#highlight').val('');