Fixed NPE in case the query parameter is not supplied.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6092 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-11-28 00:38:15 +00:00
1 parent 5e821174a3
commit 4e9c6a83ad
1 file changed
+7 -5
+7 -5
View File
@@ -35,11 +35,13 @@ public class Search {
SearchIndex index = smo.getSearchIndex();
String query = req.getParameter("q");
SuggestedItem target = find(index, query);
if(target!=null) {
// found
rsp.sendRedirect2(a.getUrl()+target.getUrl());
return;
if(query!=null) {
SuggestedItem target = find(index, query);
if(target!=null) {
// found
rsp.sendRedirect2(a.getUrl()+target.getUrl());
return;
}
}
}
}