Skip to content

Commit

Permalink
check aggregator before access
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Sep 13, 2023
1 parent d7066ca commit 5c60a89
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5c60a89

Please sign in to comment.