cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ovidiu Predescu <ovi...@cup.hp.com>
Subject [PATCH] [C2] BrowserImpl.xsl
Date Wed, 06 Jun 2001 22:48:04 GMT
This patch fixes a null pointer exception when passing browser
capabilities to the stylesheet, for browsers which are not described
in the XML database.

-- 
Ovidiu Predescu <ovidiu@cup.hp.com>
http://orion.nsr.hp.com/ (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)


Index: src/org/apache/cocoon/components/browser/BrowserImpl.xsl
===================================================================
RCS file: /Repository/Cocoon2/src/org/apache/cocoon/components/browser/BrowserImpl.xsl,v
retrieving revision 1.1.1.1
diff -u -I'\$Id:.*\$' -I'\$Author:.*\$' -I'\$Revision:.*\$' -r1.1.1.1 BrowserImpl.xsl
--- BrowserImpl.xsl	2001/05/08 18:42:19	1.1.1.1
+++ BrowserImpl.xsl	2001/06/06 22:30:44
@@ -87,7 +87,7 @@
     output markup for this browser. Note that this may also affect the
     DOCTYPE that's placed in the resulting XML document.</li>
 
-    <li><code>has-access-key</code> - whether the browser understands
+    <li><code>has-accesskey</code> - whether the browser understands
     the <code>accesskey</code> attribute as part of a
     <code>anchor</code> tag.</li>
 
@@ -151,6 +151,9 @@
    * @return a <code>String</code> value */
   public HashMap getBrowser(String userAgent, String acceptHeader)
   {
+    if (userAgent == null || userAgent.equals(""))
+      return new HashMap();
+
     /* First search for a matching user agent */
     Iterator iter = byUserAgent.iterator();
     while (iter.hasNext()) {

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message