From c99c818fc393193df8da6a8e0ea746f6e38b3733 Mon Sep 17 00:00:00 2001 From: Bill Oley Date: Tue, 10 Oct 2023 13:55:42 -0400 Subject: [PATCH] Check that !includeHeads.isEmpty in OrIterator before trying to reference the first element --- .../src/main/java/datawave/query/iterator/logic/OrIterator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/warehouse/query-core/src/main/java/datawave/query/iterator/logic/OrIterator.java b/warehouse/query-core/src/main/java/datawave/query/iterator/logic/OrIterator.java index ae682e15af..371a2d1134 100644 --- a/warehouse/query-core/src/main/java/datawave/query/iterator/logic/OrIterator.java +++ b/warehouse/query-core/src/main/java/datawave/query/iterator/logic/OrIterator.java @@ -106,7 +106,7 @@ public void initialize() { next(); } catch (WaitWindowOverrunException e) { // if prev != null then it's a match that has not been returned - T lowest = includeHeads.keySet().first(); + T lowest = includeHeads.isEmpty() ? null : includeHeads.keySet().first(); Key possibleYieldKey = null; if (prev != null || lowest != null) { possibleYieldKey = (prev != null) ? (Key) prev : (Key) lowest;