Skip to content

Commit f768ea0

Browse files
BradBot1dmulloy2
authored andcommitted
Throw NSE Exception over null
1 parent 13545ab commit f768ea0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/comphenix/protocol/reflect/StructureModifierIterator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.comphenix.protocol.reflect;
1818

1919
import java.util.Iterator;
20+
import java.util.NoSuchElementException;
2021

2122
/**
2223
* Provides iterator access to a {@link StructureModifier}
@@ -49,7 +50,7 @@ public boolean hasNext() {
4950
*/
5051
@Override
5152
public StructureModifierIntermediate<T> next() {
52-
if (!this.hasNext()) return null;
53+
if (!this.hasNext()) throw new NoSuchElementException();
5354
return new StructureModifierIntermediate<T>(this.structure, this.index++);
5455
}
5556

0 commit comments

Comments
 (0)