You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Otis Gospodnetic <ot...@yahoo.com> on 2002/04/02 07:14:56 UTC

Re: [patch] src/jsp/results.jsp Null pointer when no title

I haven't tested this, but even if it's not necessary it won't break
anything, so I'll apply this.

Thanks,
Otis

--- "Hayes, Mark" <Mh...@verisign.com> wrote:
> Here's a tiny fix for luceneweb.  When searching on documents with no
> title
> field a null pointer occurs.  Unfortunately Tomcat (4.0.2) doesn't
> report
> these exceptions as JSP page errors, so they are a little hard to
> find.
> 
> /mark
> 
> --- results.jsp	Thu Feb 14 12:53:40 2002
> +++ results.jsp.new	Sun Feb 24 16:49:00 2002
> @@ -113,7 +113,7 @@
>                          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
> +                        if (doctitle == null || doctitle.equals(""))
> //use
> the url if it has no title
>                                  doctitle = url;
>                                                                      
> //then
> output!
>  %>
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://http://taxes.yahoo.com/

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