Tuple: guard the sort against a null summary array (CodeQL) Callers pass both arrays or neither; the check makes that explicit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
diff --git a/src/main/java/org/apache/datasketches/tuple/CompactTupleSketch.java b/src/main/java/org/apache/datasketches/tuple/CompactTupleSketch.java index c461550..bbff6fb 100644 --- a/src/main/java/org/apache/datasketches/tuple/CompactTupleSketch.java +++ b/src/main/java/org/apache/datasketches/tuple/CompactTupleSketch.java
@@ -82,7 +82,7 @@ super(thetaLong, empty, null, seedHash); super.thetaLong_ = thetaLong; super.empty_ = empty; - if ((hashArr == null) || isSorted(hashArr)) { + if ((hashArr == null) || (summaryArr == null) || isSorted(hashArr)) { //callers pass both or neither hashArr_ = hashArr; summaryArr_ = summaryArr; } else {