W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2009

2006/unicorn/src/org/w3c/unicorn/action ObserveAction.java,1.1.2.8,1.1.2.9

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 25 Aug 2009 08:49:22 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MfriU-000397-LN@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action
In directory hutz:/tmp/cvs-serv12079/src/org/w3c/unicorn/action

Modified Files:
      Tag: dev2
	ObserveAction.java 
Log Message:
fixed NPE when url is less than 7 characters 

Index: ObserveAction.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/Attic/ObserveAction.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -d -r1.1.2.8 -r1.1.2.9
--- ObserveAction.java	24 Aug 2009 11:17:00 -0000	1.1.2.8
+++ ObserveAction.java	25 Aug 2009 08:49:20 -0000	1.1.2.9
@@ -308,13 +308,15 @@
 		} else if (sParamName.equals("uri")) {
 			aUnicornCall.setEnumInputMethod(EnumInputMethod.URI);
 			// TODO First check that tStringParamValue[0] is at least 7 characters long
-			if (!tStringParamValue[0].substring(0, 7).equals("http://")) {
+			if (tStringParamValue[0].length() < 7 || !tStringParamValue[0].substring(0, 7).equals("http://")) {
 				ObserveAction.logger.info("URI missing protocol : "
 						+ tStringParamValue[0]);
 				tStringParamValue[0] = "http://" + tStringParamValue[0];
 				ObserveAction.logger.info("URI modified to : "
 						+ tStringParamValue[0]);
 			}
+			
+			
 
 			aUnicornCall.setDocumentName(tStringParamValue[0]);
 			aUnicornCall.setInputParameterValue(tStringParamValue[0]);
Received on Tuesday, 25 August 2009 08:49:32 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:38 UTC