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

2002/css-validator/org/w3c/css/properties/css1 Css1Style.java,1.13,1.14

From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 05 Feb 2009 14:56:10 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1LV5eE-0007LV-KW@lionel-hutz.w3.org>

Update of /sources/public/2002/css-validator/org/w3c/css/properties/css1
In directory hutz:/tmp/cvs-serv28217/org/w3c/css/properties/css1

Modified Files:
	Css1Style.java 
Log Message:
fixing a potential NullPointerException

Index: Css1Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/Css1Style.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- Css1Style.java	4 Feb 2009 15:16:39 -0000	1.13
+++ Css1Style.java	5 Feb 2009 14:56:08 -0000	1.14
@@ -2566,8 +2566,14 @@
     if (cssFloat != null) {
         if(cssWidth == null ) {
             String selectorElement =  selector.getElement();
-            if ((selectorElement.equals("html")) || (selectorElement.equals("img")) || (selectorElement.equals("input")) 
-            || (selectorElement.equals("object")) || (selectorElement.equals("textarea")) || (selectorElement.equals("select"))) {
+            if (selectorElement != null){
+                if ((selectorElement.equals("html")) || (selectorElement.equals("img")) || (selectorElement.equals("input")) 
+                || (selectorElement.equals("object")) || (selectorElement.equals("textarea")) || (selectorElement.equals("select"))) {
+                }
+                else {
+                    // for elements without intrinsic width, float needs a declared width
+        		    warnings.addWarning(new Warning(cssFloat, "float-no-width", 1, ac));                
+                }
             }
             else {
                 // for elements without intrinsic width, float needs a declared width
Received on Thursday, 5 February 2009 14:56:20 GMT

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