diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/xml/Element.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/xml/Element.java b/src/main/java/de/pixart/messenger/xml/Element.java index e9eaa1394..d7cace655 100644 --- a/src/main/java/de/pixart/messenger/xml/Element.java +++ b/src/main/java/de/pixart/messenger/xml/Element.java @@ -73,7 +73,7 @@ public class Element { return findInternationalizedChildContent(name, Locale.getDefault().getLanguage()); } - public String findInternationalizedChildContent(String name, @NonNull String language) { + private String findInternationalizedChildContent(String name, @NonNull String language) { HashMap<String, String> contents = new HashMap<>(); for (Element child : this.children) { if (name.equals(child.getName())) { @@ -88,8 +88,11 @@ public class Element { } } } - - return contents.get(null); + String value = contents.get(null); + if (value != null) { + return value; + } + return contents.size() > 0 ? contents.values().iterator().next() : null; } public Element findChild(String name, String xmlns) { |