The current BrowserDetector assumes that all user agents will have a
space after the "Name/Version" combination.  Any such user agent (like
"wget" for instance, which reports "Wget/1.5.3") will cause a
"NullPointerException".

******************        BEGIN PATCH          ****************
*** turbine/src/java/org/apache/turbine/util/BrowserDetector.java      
Wed Mar  8 23:05:39 2000
--- turbine_local/src/java/org/apache/turbine/util/BrowserDetector.java
Mon Jun 26 14:00:43 2000
***************
*** 131,137 ****
          browserName = userAgentString.substring( 0, versionStartIndex
);
          try
          {
!             browserVersion = toFloat( userAgentString.substring(
versionStartIndex+1, versionEndIndex ) );
          }
                catch (NumberFormatException e)
                {
--- 131,143 ----
          browserName = userAgentString.substring( 0, versionStartIndex
);
          try
          {
!             // Not all user agents will have a space in the reported
string
!             String agentSubstring = null;
!             if ( versionEndIndex < 0 )
!                 agentSubstring = userAgentString.substring(
versionStartIndex+1 );
!             else
!                 agentSubstring = userAgentString.substring(
versionStartIndex+1, versionEndIndex );
!             browserVersion = toFloat( agentSubstring );
          }
                catch (NumberFormatException e)
                {
*********         END PATCH          ***************

-- 
#############################################################
##                  J.C.  [EMAIL PROTECTED]
##               -- Idiot Extrodinare --
#############################################################


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to