From b8d6c17308cc60649e154e30118395fbc0bb8765 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 14 Feb 2016 16:30:42 -0600 Subject: [PATCH] Issue 118: Typing a project list into project name search then hitting entire will take you to a 404 --- indefero/www/media/idf/js/projectsearch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indefero/www/media/idf/js/projectsearch.js b/indefero/www/media/idf/js/projectsearch.js index 81387b2..364058e 100644 --- a/indefero/www/media/idf/js/projectsearch.js +++ b/indefero/www/media/idf/js/projectsearch.js @@ -2,8 +2,9 @@ $(document).ready(function() { $("#prjname").keydown(function(ev) { - if(ev.which === 13) { - window.location.replace($('.projectitem :visible').first().attr("href")); + var link = $('.projectitem :visible').first().attr("href"); + if(ev.which === 13 && link != undefined) { + window.location.replace(link); } });