Author: jonesde
Date: Fri Sep 14 19:07:03 2007
New Revision: 575853
URL:
http://svn.apache.org/viewvc?rev=575853&view=revLog:
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);