svn commit: r575853 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilXml.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r575853 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilXml.java

jonesde
Author: jonesde
Date: Fri Sep 14 19:07:03 2007
New Revision: 575853

URL: http://svn.apache.org/viewvc?rev=575853&view=rev
Log:
Small validation improvement

Modified:
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilXml.java

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilXml.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilXml.java?rev=575853&r1=575852&r2=575853&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilXml.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilXml.java Fri Sep 14 19:07:03 2007
@@ -421,6 +421,7 @@
      * returns the first element. */
     public static Element firstChildElement(Element element, String childElementName) {
         if (element == null) return null;
+        if (UtilValidate.isEmpty(childElementName)) return null;
         // get the first element with the given name
         Node node = element.getFirstChild();
 
@@ -429,7 +430,6 @@
                 if (node.getNodeType() == Node.ELEMENT_NODE && (childElementName == null ||
                         childElementName.equals(node.getNodeName()))) {
                     Element childElement = (Element) node;
-
                     return childElement;
                 }
             } while ((node = node.getNextSibling()) != null);