Skip to content

The Unified and Autonomous Development Platform

Fix possible null bug

Thomas Terry9bcba525db88
diff --git a/server-core/src/main/java/io/onedev/server/util/FilterIterator.java b/server-core/src/main/java/io/onedev/server/util/FilterIterator.java
index da3a0aa613..38fdaca52d 100644
--- a/server-core/src/main/java/io/onedev/server/util/FilterIterator.java
+++ b/server-core/src/main/java/io/onedev/server/util/FilterIterator.java
@@ -26,7 +26,7 @@ public class FilterIterator<T> implements Iterable<T> {
return false;
}
T next = sourceIterator.next();
- if (predicate.test(next)) {
+ if (next != null && predicate.test(next)) {
current = next;
hasCurrent = true;
}