From 5c60a896413e2b817958469f2998e2ee78525607 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 13 Sep 2023 09:53:44 +0200 Subject: [PATCH 1/2] check aggregator before access --- .../iot/cygnus/aggregation/NGSIGenericColumnAggregator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java index 06086cb70..5e75c49ea 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java @@ -98,7 +98,10 @@ public void initialize(NGSIEvent event) { @Override public void aggregate(NGSIEvent event) { // Number of previous values - int numPreviousValues = getAggregation().get(NGSIConstants.FIWARE_SERVICE_PATH).size(); + int numPreviousValues = 0; + if (getAggregation().get(NGSIConstants.FIWARE_SERVICE_PATH) != null) { + numPreviousValues = getAggregation().get(NGSIConstants.FIWARE_SERVICE_PATH).size(); + } // get the servicePath from event String eventServicePath = event.getServicePathForData(); // Get the event headers From fb93e8442bf58cd9dbac03a1717d18db1460e01a Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 13 Sep 2023 11:53:28 +0200 Subject: [PATCH 2/2] update CNR --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 2119a432f..15a50cd7f 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,3 +1,4 @@ +- [cygnus-ngsi] Fix runtime error: check access aggregator size (#2293) - [cygnus-ngsi] Switch log level to CYGNUS_LOG_LEVEL env var if was provided to docker (#2286) - [cygnus-common][SQL] Fix expiration records tablename used by delete and select (#2265) - [cygnus-common][SQL] Fix expiration records select with a limit to avoid java out of memory error (#2273)