summaryrefslogtreecommitdiffstats
path: root/vespajlib
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-08-24 12:22:36 +0200
committerJon Bratseth <bratseth@gmail.com>2022-08-24 12:22:36 +0200
commit69c3cfc1828aab9d759126df90667067e88490cb (patch)
tree6f7a2c7626f6aa92aaa01e6d2f46dec5a6971b1c /vespajlib
parent750442815177bf4f1ed6ff375ab5c0160a065090 (diff)
Test model id lookup
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/src/main/java/com/yahoo/text/XML.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/text/XML.java b/vespajlib/src/main/java/com/yahoo/text/XML.java
index 6aa42773ac0..ec2791eefe8 100644
--- a/vespajlib/src/main/java/com/yahoo/text/XML.java
+++ b/vespajlib/src/main/java/com/yahoo/text/XML.java
@@ -559,13 +559,10 @@ public class XML {
* the element is null, or has no content
*/
public static String getValue(Element e) {
- if (e == null) {
- return "";
- }
+ if (e == null) return "";
Node child = e.getFirstChild();
- if (child == null) {
- return "";
- }
+ if (child == null) return "";
+ if (child.getNodeValue() == null) return "";
return child.getNodeValue();
}