File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
common/src/main/java/org/tron/common/utils Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 2424import java .util .HashMap ;
2525import java .util .Iterator ;
2626import java .util .Map ;
27+ import java .util .NoSuchElementException ;
2728import java .util .Set ;
2829import org .tron .core .db .ByteArrayWrapper ;
2930
@@ -154,6 +155,9 @@ public boolean hasNext() {
154155
155156 @ Override
156157 public Entry <byte [], V > next () {
158+ if (!hasNext ()) {
159+ throw new NoSuchElementException ();
160+ }
157161 Entry <ByteArrayWrapper , V > next = it .next ();
158162 return Maps .immutableEntry (next .getKey ().getData (), next .getValue ());
159163 }
Original file line number Diff line number Diff line change 2222import java .util .Collection ;
2323import java .util .HashSet ;
2424import java .util .Iterator ;
25+ import java .util .NoSuchElementException ;
2526import java .util .Set ;
2627import org .tron .core .db .ByteArrayWrapper ;
2728
@@ -68,6 +69,9 @@ public boolean hasNext() {
6869
6970 @ Override
7071 public byte [] next () {
72+ if (!hasNext ()) {
73+ throw new NoSuchElementException ();
74+ }
7175 return it .next ().getData ();
7276 }
7377
You can’t perform that action at this time.
0 commit comments