- Applied Mark Hayes' patch to avoid NPE.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149719 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Otis Gospodnetic 2002-04-02 05:15:43 +00:00
parent 678386d4e9
commit b5e126c654
1 changed files with 5 additions and 5 deletions

View File

@ -110,12 +110,12 @@
%> %>
<tr> <tr>
<% <%
Document doc = hits.doc(i); //get the next document Document doc = hits.doc(i); //get the next document
String doctitle = doc.get("title"); //get its title String doctitle = doc.get("title"); //get its title
String url = doc.get("url"); //get its url field String url = doc.get("url"); //get its url field
if (doctitle.equals("")) //use the url if it has no title if ((doctitle == null) || doctitle.equals("")) //use the url if it has no title
doctitle = url; doctitle = url;
//then output! //then output!
%> %>
<td><a href="<%=url%>"><%=doctitle%></a></td> <td><a href="<%=url%>"><%=doctitle%></a></td>
<td><%=doc.get("summary")%></td> <td><%=doc.get("summary")%></td>