You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by ot...@apache.org on 2002/04/02 07:15:43 UTC

cvs commit: jakarta-lucene/src/jsp results.jsp

otis        02/04/01 21:15:43

  Modified:    src/jsp  results.jsp
  Log:
  - Applied Mark Hayes' patch to avoid NPE.
  
  Revision  Changes    Path
  1.2       +5 -5      jakarta-lucene/src/jsp/results.jsp
  
  Index: results.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/jsp/results.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- results.jsp	26 Jan 2002 15:01:32 -0000	1.1
  +++ results.jsp	2 Apr 2002 05:15:43 -0000	1.2
  @@ -110,12 +110,12 @@
   %>
                   <tr>
   <%
  -                        Document doc = hits.doc(i);                  //get the next document 
  -                        String doctitle = doc.get("title");          //get its title
  -                        String url = doc.get("url");                 //get its url field
  -                        if (doctitle.equals(""))                     //use the url if it has no title
  +                        Document doc = hits.doc(i);                    //get the next document 
  +                        String doctitle = doc.get("title");            //get its title
  +                        String url = doc.get("url");                   //get its url field
  +                        if ((doctitle == null) || doctitle.equals("")) //use the url if it has no title
                                   doctitle = url;
  -                                                                     //then output!
  +                                                                       //then output!
   %>
                           <td><a href="<%=url%>"><%=doctitle%></a></td>
                           <td><%=doc.get("summary")%></td>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>