Skip to content
This repository was archived by the owner on Mar 15, 2023. It is now read-only.

Commit eb71d60

Browse files
author
Jacob van Mourik
committed
Added null check.
1 parent 05b7f2e commit eb71d60

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/com/jvms/i18neditor/TranslationTree.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ public void renameNodeByKey(String key, String newKey) {
9090
// Store expansion state of old tree
9191
List<TranslationTreeNode> expandedNodes = Lists.newLinkedList();
9292
Enumeration<TreePath> expandedChilds = getExpandedDescendants(new TreePath(oldNode.getPath()));
93-
while (expandedChilds.hasMoreElements()) {
94-
TreePath path = expandedChilds.nextElement();
95-
expandedNodes.add((TranslationTreeNode) path.getLastPathComponent());
93+
if (expandedChilds != null) {
94+
while (expandedChilds.hasMoreElements()) {
95+
TreePath path = expandedChilds.nextElement();
96+
expandedNodes.add((TranslationTreeNode) path.getLastPathComponent());
97+
}
9698
}
9799

98100
// Remove old and any existing new tree

0 commit comments

Comments
 (0)