Skip to content

Commit 31ed3dc

Browse files
authored
0.74.0
* Fix NPE in node iterators.
2 parents b51bb61 + bd64bf3 commit 31ed3dc

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ subprojects {
55
apply plugin: 'maven'
66

77
group 'org.iot-dsa'
8-
version '0.74.0'
8+
version '0.74.1'
99

1010
targetCompatibility = JavaVersion.VERSION_1_8
1111
sourceCompatibility = JavaVersion.VERSION_1_8

dslink-v2-api/src/main/java/org/iot/dsa/node/DSNode.java

+14-8
Original file line numberDiff line numberDiff line change
@@ -1638,10 +1638,13 @@ private class NodeIterator implements Iterator<DSInfo<DSNode>> {
16381638
private DSInfo<DSNode> next;
16391639

16401640
NodeIterator() {
1641-
if (firstChild.isNode()) {
1642-
next = (DSInfo<DSNode>) firstChild;
1643-
} else {
1644-
next = firstChild.nextNode();
1641+
DSInfo<?> first = getFirstInfo();
1642+
if (first != null) {
1643+
if (first.isNode()) {
1644+
next = (DSInfo<DSNode>) first;
1645+
} else {
1646+
next = first.nextNode();
1647+
}
16451648
}
16461649
}
16471650

@@ -1721,10 +1724,13 @@ private class ValueIterator implements Iterator<DSInfo<DSIValue>> {
17211724
private DSInfo<DSIValue> next;
17221725

17231726
ValueIterator() {
1724-
if (firstChild.isValue()) {
1725-
next = (DSInfo<DSIValue>) firstChild;
1726-
} else {
1727-
next = firstChild.nextValue();
1727+
DSInfo<?> first = getFirstInfo();
1728+
if (first != null) {
1729+
if (first.isValue()) {
1730+
next = (DSInfo<DSIValue>) first;
1731+
} else {
1732+
next = first.nextValue();
1733+
}
17281734
}
17291735
}
17301736

0 commit comments

Comments
 (0)