From f598e5886085430b12a9dbc644c4347f32247b1e Mon Sep 17 00:00:00 2001 From: Samuel Pelletier Date: Mon, 10 Jun 2024 12:04:51 -0400 Subject: [PATCH] Prevent a NPE when using groupBy with an attribute in ERXQuery by initializing the array in constructor like groupingKeys. --- .../Core/ERExtensions/Sources/er/extensions/eof/ERXQuery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXQuery.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXQuery.java index ef44c54ad3f..7cd5bba8d0e 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXQuery.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/ERXQuery.java @@ -311,6 +311,7 @@ protected ERXQuery() { // Set defaults fetchKeys = new NSMutableArray<>(); groupingKeys = new NSMutableArray<>(); + groupingAttributes = new NSMutableArray<>(); orderings = new NSMutableArray<>(); refreshRefetchedObjects = false; usesDistinct = false; @@ -1275,7 +1276,6 @@ protected void computeSelectAndGroupingAttributes() { // Initialize arrays for storing the select attributes, // grouping attributes and sort orderings selectAttributes = new NSMutableArray<>(20); - groupingAttributes = new NSMutableArray<>(20); // This keeps track of EOAttribute objects used attributesByName = new NSMutableDictionary<>();