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

2006/unicorn/src/org/w3c/unicorn UnicornCall.java,1.27,1.28

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 30 Sep 2009 13:40:38 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MszQ6-0007wv-7e@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn
In directory hutz:/tmp/cvs-serv30539/src/org/w3c/unicorn

Modified Files:
	UnicornCall.java 
Log Message:
removed a potential NPE from getObserverName method

Index: UnicornCall.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/UnicornCall.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- UnicornCall.java	30 Sep 2009 11:36:00 -0000	1.27
+++ UnicornCall.java	30 Sep 2009 13:40:36 -0000	1.28
@@ -397,9 +397,9 @@
 		}
 	}
 	
-	public void addParameter(final String sName, final String tStringValue) {
-		String[] tab = {tStringValue};
-		addParameter(sName, tab);
+	public void addParameter(final String name, final String value) {
+		String[] tab = {value};
+		addParameter(name, tab);
 	}
 	
 	public String getDocumentName() {
@@ -407,6 +407,8 @@
 	}
 	
 	public String getObserverName(String observer, String lang) {
+		if (Framework.mapOfObserver.get(observer).getName(lang) == null)
+			return Framework.mapOfObserver.get(observer).getID();
 		return Framework.mapOfObserver.get(observer).getName(lang);
 	}
 	
Received on Wednesday, 30 September 2009 13:40:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:14 GMT